Ducky Posted March 17, 2008 Share Posted March 17, 2008 I'm currently running a script to upload an image and store it as a blob in the database. This works fine, so the next step of progression for this script was to continue by getting the script to resize the image and then upload it to the DB too. $thumb = @ImageCreateTrueColor ($this->w, $this->h); @ImageCopyResampled ($thumb, $im, 0, 0, 0, 0, $this->w, $this->h, $original_width, $original_height); ob_start(); @ImageJPEG ($thumb); $bufferoutput = ob_get_contents(); ob_end_clean(); $image = addslashes($bufferoutput); As you can see from this, I've been using the buffer to put the smaller image into a variable for upload later. This method seems somewhat "dirty" to me and i was wondering if there is a way to upload the data generated from imageJPEG directly instead. Anyway, I would really appreceate or advice, even if its might not be what I want to hear, as at least then I can stop second guessing myself over it. Thanks In advance. Link to comment https://forums.phpfreaks.com/topic/96525-gd-imagejpeg-question/ Share on other sites More sharing options...
Ducky Posted March 17, 2008 Author Share Posted March 17, 2008 Bump for help! Link to comment https://forums.phpfreaks.com/topic/96525-gd-imagejpeg-question/#findComment-494072 Share on other sites More sharing options...
BlueSkyIS Posted March 17, 2008 Share Posted March 17, 2008 i suggest that you store the name of the image and not the image itself. copy the main image to a directory, then duplicate it resized for the thumbnail. Link to comment https://forums.phpfreaks.com/topic/96525-gd-imagejpeg-question/#findComment-494191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.