hassank1 Posted April 4, 2008 Share Posted April 4, 2008 the tutorial that I've read abt image resizing suppose that image exist in a path ex: $file='\picutre.jpg' ; however .. I've saved my images into a database ... so I want to get the image from the db then resize it save it back in a new record in my DB with the new size ... ex: "select imagedata from ...." .. $imagedata= image data from DB... so I want to resize my picture but the variable that I've is the image binary and not the path .. so how can I resize it ? and how can I get the new filesize , and filetype? Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/ Share on other sites More sharing options...
Yesideez Posted April 4, 2008 Share Posted April 4, 2008 If you want to resize the image purely for display purposes then why not just specify different width and height values in the HTML? Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509219 Share on other sites More sharing options...
hassank1 Posted April 4, 2008 Author Share Posted April 4, 2008 nop the main reason is to decrease a file size..I want to use images a a profile pictures for users.. so if files are each 40 KB !! I think this is a problem ..so I want to keep the original + the thumbnail Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509221 Share on other sites More sharing options...
hassank1 Posted April 4, 2008 Author Share Posted April 4, 2008 anyone has the solution ? Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509243 Share on other sites More sharing options...
Yesideez Posted April 4, 2008 Share Posted April 4, 2008 You want to create a thumbnail image from the original and store it somewhere? http://www.google.com/search?q=php+make+thumbnail&sourceid=navclient-ff&ie=UTF-8&rlz=1B2DVFC_enGB224GB224 Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509245 Share on other sites More sharing options...
hassank1 Posted April 4, 2008 Author Share Posted April 4, 2008 create thumbnail from binary data .. I've found the function : $im = imagecreatefromstring($content); I am going to test it .. anyway thx... Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509248 Share on other sites More sharing options...
craygo Posted April 4, 2008 Share Posted April 4, 2008 Why store 2 picture when you can store one and resize it to whatever you like. Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509253 Share on other sites More sharing options...
hassank1 Posted April 4, 2008 Author Share Posted April 4, 2008 I've read somewhere that it's better to do that .. instead of use php to process the pictures for you each time..especially when you've many picture to be resized per page !! Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509260 Share on other sites More sharing options...
hassank1 Posted April 4, 2008 Author Share Posted April 4, 2008 so what do u think ? does it really affect performance and speed ... 1-save 2 recrods .. or 2-resize picture "on the fly" ? Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509269 Share on other sites More sharing options...
craygo Posted April 4, 2008 Share Posted April 4, 2008 I have a script to resize images on the fly but the forum won't let me post the code for some reason. If you like you can get it here http://theelders.net/misc/scripts.php?task=select&id=1 just copy the code. Ray Link to comment https://forums.phpfreaks.com/topic/99540-resize-image-from-database/#findComment-509271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.