Browse > Home / Webmaster Tutorials / PHP Image Resize Script

| Subcribe via RSS

PHP Image Resize Script

May 30th, 2009 Posted in Webmaster Tutorials

This is a little script that is very handy for webmasters who often use the loading of images. As you already may have noticed somethimes images tend to go bad when resizing. That’s why I’m sharing this script with you all. This is definately not hard to modify and I will do my best to explain everything.

This is a simple script that onyl requires the editing of 1 line:

First of all here is how it works:

Resize an image to 25 x 25
<img src=”imgsize.php?w=25&h=25&img=path/to/image.jpg”>

Resize an image to 50% the size
<img src=”iimgsize.php?percent=50&img=path/to/image.jpg”>

Resize an image to 50 pixels wide and autocompute the height
<img src=”iimgsize.php?w=50&img=path/to/image.jpg”>

Resize an image to 100 pixels tall and autocompute the width
<img src=”iimgsize.php?h=100&img=path/to/image.jpg”>

Resize to 50 pixels width OR 100 pixels tall, whichever resulting image is smaller
<img src=”iimgsize.php?w=50&h=100&constrain=1&img=path/to/image.jpg”>

But first of all upload this code to a php file and name it imgsize.php
imgsize.txt

Greetz

Related posts:

  1. Prevent Image Hotlinking It’s always a pain in the ass if you are...
  2. Simple PHP Users Online Script It’s always handy to have a simple script on your...
  3. Affiliate Image Have you ever wondered how they have so cool affiliate...

Related posts brought to you by Yet Another Related Posts Plugin.

3 Responses to “PHP Image Resize Script”

  1. cyprus advertising Says:

    Great! Hope that script will work fast. I will test it on my project and then will feedback.

    See ya!


  2. alex farguson Says:

    I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.


  3. jack parler Says:

    I really liked your blog!


Leave a Reply

You must be logged in to post a comment.