Crop and resize images on the fly

To be able to crop images to many different sizes (not just fullsize and thumbnail), you can combine upm_image and Smart Image Resizer, a simple to use php script.

From the SIR site, here is a description of the script:

The major advantage of this script is that it allows me to resize and crop any image on my website without touching the actual image or writing any code. I upload each image once at a high enough resolution and can then reuse it at any size I want, anywhere I want. It doesn’t matter if the images are in a post, on a page, or in a template file–it just works.

Two simple steps:

  1. Upload SIR according to the instructions on their page
  2. Install and activate upm_image

On your textpattern form or page, use the following code:

<txp:upm_article_image form="myImage" />

Create a form called “myImage” and in that form write:

<img src="/image.php?width=390&amp;quality=95&amp;image=<txp:upm_img_full_url />" alt="<txp:upm_img_alt />" />

Additional parameters/options can be found on the SIR page.

Source for the tip is here on the Textpattern forum.

comments powered by Disqus