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. Quote Link to comment Share on other sites More sharing options...
Ducky Posted March 17, 2008 Author Share Posted March 17, 2008 Bump for help! Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.