Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

EE2+ Version of the ED ImageResizer. Resizes, crops and caches images on the fly.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.textile
Octocat-spinner-32 pi.ed_imageresizer.php
README.textile

ED Image resizer for ExpressionEngine 2.x

Resize images on the fly

Installation

  1. Copy pi.ed_imageresizer.php to system/expressionengine/third_party/ed_imageresizer/
  2. Add path variables to your config at system/expressionengine/config/config.php:
$config['ed_server_path'] = '/var/www/html/'; // Server path to your site's web root
$config['ed_cache_path'] = '/var/www/html/media/images/resizer_cache/'; // Server path to where your resized images should be stored

Usage

Parameters

  • image (string) required : the file to resize
  • maxWidth (integer) : maximum width of the resized image
  • maxHeight (integer) : maximum height of the resized image
  • forceWidth (boolean “yes” or “no”, default “no”) : will force the width, even if the original’s width is less
  • forceHeight (boolean “yes” or “no”, default “no”) : will force the height, even if the original’s height is less
  • cropratio (string format “integer:integer”) : crops the image to the defined ratio
  • default (string) : a backup image to use if the image is not found
  • alt (string) : an alt tag for the image
  • class (string) : a class for the image tag
  • id (string) : an ID for the image tag
  • title (string) : a title for the image tag
  • href_only (boolean “yes” or “no”, default “no”) : if yes, will return only the href, not the image tag
  • debug (boolean “yes” or “no”, default “no”) : will optionally output an error message if one is encountered, otherwise will fail silently
  • grayscale (boolean “yes” or “no”, default “no”) : grayscales the resized image

Usage example

{exp:ed_imageresizer
    image="{my_image_field}"
    default="/images/site/default_image.png"
    maxWidth="100"
    cropratio="100:120"
    class="my_class"
    alt="Image description"
    grayscale="yes"
    }

Would then output the following:

<img src="/media/images/resizer_cache/resized_image.jpg" width="100" height="120" alt="Image description" />
Something went wrong with that request. Please try again.