[SOLVED] Edit image then move it?

This is a discussion on "[SOLVED] Edit image then move it?" within the PHP Forum section. This forum, and the thread "[SOLVED] Edit image then move it? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 8th, 2007, 17:29
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
[SOLVED] Edit image then move it?

I have an image that is being uploaded then converted to a thumbnail,
how can I choose the name of the file(by choose I meant a variable based on some mysql things) I edit into a thumbnail then move it to a folder in the root of my website?
This is the PHP that opens the file then edits it to 200pcx200px

PHP: Select all

$image $img->openImage($_FILES['uploadfile']['tmp_name']);
if (
$image === false) { die ('Unable to open image'); }

// Get original width and height
$width imagesx($image);
$height imagesy($image);

// New width and height
$new_width 200;
$new_height 200;

// Resample
$image_resized imagecreatetruecolor($new_width$new_height);
imagecopyresampled($image_resized$image0000$new_width$new_height$width$height); 
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote

  #2 (permalink)  
Old Nov 8th, 2007, 17:49
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Edit image then move it?

Oh and the image can be displayed like so,
PHP: Select all

    header('Content-type: image/jpeg');
imagejpeg($image_resized); 
But I don't know how to put it anywhere :/
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Nov 8th, 2007, 17:58
Junior Member
Join Date: Nov 2007
Location: Norwich, UK
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Edit image then move it?

You just need to add a second parameter, for example:

PHP: Select all

imagejpeg($image_resized'/your/location/file.jpg'); 

Take a look at the full spec of the function here:

http://uk.php.net/manual/en/function.imagejpeg.php

James.
Reply With Quote
  #4 (permalink)  
Old Nov 8th, 2007, 18:04
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Edit image then move it?

Thanks mate will test it now!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #5 (permalink)  
Old Nov 8th, 2007, 18:07
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: [SOLVED] Edit image then move it?

Solved! +rep!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
image/text move on mouseover aprilpgb22 JavaScript Forum 1 Jun 18th, 2008 22:08
edit xml image files that load into flash Janisf Flash & Multimedia Forum 1 Dec 21st, 2007 08:43
[SOLVED] Problem with Mac and Text Edit Claridge Starting Out 6 Nov 29th, 2007 08:43
[SOLVED] multiple image rollover not restoring image snappy JavaScript Forum 4 Nov 5th, 2007 14:38
[SOLVED] image Anonymous User Web Page Design 3 Nov 6th, 2004 19:41


All times are GMT. The time now is 02:17.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43