Like many other people, I found Mike Lopez’s image thumbnail script quite useful. He has taken the time to go through the brain-crunching algorithm to create image proportional image thumbnails when given a max height/width. Although this script is very handy, it was lacking in a few areas, such as transparent PNG and GIF support, as well as the un-needed resize if the image was smaller than the requested dimensions. I hope I have “helped” in this situation by modifying the script so that it handles such requests. Credit for the transparency support goes to Martin Schmidt (icheee).
One modification I made that is important to note is that the image is now fed through with the SRC variable, rather than the IMG variable. Thanks Mike for this script and I hope my updates really help.
Last Update: 2008-01-10 23:12 CST
* fixed resize issue where only 1 dimension was provided.
You need to change the filename to download from image.php to another extension like image.phps in order for people to download…
I can’t copy and paste the actual text above because the text because all crumpled up.
I changed the code highlighter plugin to something a little better. You should be able to copy it now.
I have made sure already that the image does exist. In my case, the image is on my server, but it will not always be this case. I’d like this to work with all images on any server.
Thanks.
The script has been updated to support remote images. Should work the exact same, just use a remote file URL rather than a relative URL in the SRC variable. Let me know if you have any questions.
Hi,
great script, thanks for this!!!
need a feature, crop image
Thanks!
Great script! Especially the feature to resize remote images.
Haven’t seen that in the other scripts I’ve looked at (http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/, http://shiftingpixel.com/2008/03/03/smart-image-resizer/).
But those scripts do have file caching, is there anyone who knows how to add that to this script? I’ve tried combining some parts but not succesfully yet, so far…
[…] https://briandichiara.com/image-thumbnail-creator/ […]
Thank you, thank you, thank you for modifying this script. It works perfectly.
Looks very nice Brian!
Have not tested it yet, but looks very nice. Just one question: What about at cache for the tumbnails? Is it just to change sometning in the code, make a folder (777) and it would work?
Why cache you said? Slow remote server…
Thanks:)
Dear Brian, just a question since you are (and I am not, not yet) a CodeIgnitor user. I noticed that there is also an image maniputalor class in CI. Can that not do what your script above does?
Btw, nice that you also discovered PHPDesigner 🙂
Yes, Alexander. This post was written LONG before I discovered CI. CI rocks, although I actually haven’t messed with CI’s Image Manipulation Library very much. (not at all actually) You should give it a try!