resize image before saving to mysql as blob
Posted by jonbond (jonbond), 2 May 2007hello,
I have a web form that allows a user to upload a picture. I want to resize this image to a 180 pixel heigth, then store the thumbnail as a blob in mysql.
Here is what I have so far, but unfortuneatly, this code only stores the address of the resized image to mysql:
How do I convert the resized image ($thumb) to a jpeg, and store it as a blob in mysql?
Thank you for any help or advice, -jon
Posted by admin (Graham Ellis), 2 May 2007As a quick fix, Jon, I would save the resampled image to a temportary file, read it back into a variable, and save that to the database. I'm on the road at the moment - please feed back further if that doesn't point you in the right direction and I'll get back further in a day or two
Posted by jonbond (jonbond), 2 May 2007Thanks for your quick reply Graham. I tried your suggestion and now it is working with the following added code:
BTW, thanks for posting all your great examples. This site is very resourcefull and much appreciated.
Comment by Anon (published 2011-02-18)
Thanks for this. [#3870]
You can Add a comment or ranking or edit your own comments
There are presently 1 new comment(s) pending publication on this page
Average page ranking - 5.0
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho