PHP Image Resize Script
After spending *hours* trying to find that perfect php image resize script, and not having any luck at all btw, I stumbled across a blog post by Mike Lopez: PHP Image Resize Script.
Here’s what it does:
- Resize by specified height or width OR by percentage
- Works with both external and onsite images
- Works with JPG, PNG and GIF* (if GD is configured properly)
I think I uploaded, installed, tricked out about 2 dozen scripts last night. Mike’s script beats them all — hands down. Output image quality is very good too, best of the bunch.
The script initially didn’t support GIFs, but Mike was kind enough to work that out for me when I asked for help. Some days it would be so much easier if I was a php guru! lol
Grab the script for yourself, believe me — this one’s a keeper:
Sidenote: You will need to have gif support enabled in your GD config to view GIF files. Here’s how to find that out:
Create a php file (checkphpinfo.php) with this:
<?phpinfo()?>
Save & Upload
View the file, (ie. http://superaff.com/checkphpinfo.php)
Find the section for gd
You should see GIF Read Support and GIF Create Support enabled. If you don’t have that enabled, check with your host. They may enable it for you.
If you want a way to resize a bunch of offsite images (affiliate products, whatever), this image resize script is just the ticket.
Thanks Mike!
Edit Quick Fix: ooops I meant JPG, PNG and GIF.
Edit Again: updated link at new location (thanks for the update Derrick)
scat:
April 16th, 2006 at 7:57 am
Hi
well, fine but Mikes script is offline, isn´t it?
Terry:
April 16th, 2006 at 8:44 pm
Eduardo:
May 11th, 2007 at 12:29 pm
Hey there!
This seems to be a good one. I’ll try it!
By the way, do you know how to calculate proportional sizes to create image thumbnails?
Thanks !
Eduardo.
Derrick:
July 25th, 2007 at 11:57 am
Here is an updated link.
http://tech.mikelopez.info/2006/03/02/php-image-resize-script/
Yusuf Tokgoz:
December 1st, 2007 at 11:29 pm
hello, i wonder does it also make the file size of the picture smaller too? for example if i add a 800X600 picture with 500 kb and use this script to make the picture 200X15 will the size of 500kb will be about 100kb?
Terry:
December 3rd, 2007 at 9:26 am