Got the resize part down, but I'm curious to the script for saving the resized image in a folder that I specify. I have a feeling that it's in the ImageCopyResized or ImageJpeg functions, but I couldn't find anything. What I am doing is having a user upload an image of a product and from there create a thumbnail. Then, save the thumb in a folder as well as the original, or at least a resized of the original (so people dont post 30mb images).
Thanks for any links or whatnot!
Image Resizing/Saving
Moderator: General Moderators
imageJpeg
depending on what format you are using to create the smaller image use.
imageJpeg($handel, 'location and name');
manual page
[php_man]imagejpeg[/php_man]
imageJpeg($handel, 'location and name');
manual page
[php_man]imagejpeg[/php_man]
just use the write image(format);The filename argument is optional, and if left off, the raw image stream will be output directly.
I'll give er a try. And... it's not the uploading I'm inquiring about, it's another thing entirelytimvw wrote:instead of echo'ing it out... just fwrite it to a fileand handling file uploads has been explained many times before in this forum
Thanks for the replies
Edit: Little bit of tinkering and came up with this:
Code: Select all
$thumb_ = explode(".", $_FILES['image_path']['name']);
$thumb_name = $thumb_[0];
$thumb_path = "members/".$_SESSION['username']."/".($thumb_name."_thumb.jpg");
ImageJpeg($dst, "$thumb_path", 100);what I said
that's what i said.
the manual is your friend.
the manual is your friend.