h1. ED Image resizer for ExpressionEngine 2.x
Resize images on the fly
h2. Installation
Copy pi.ed_imageresizer.php to @system/expressionengine/third_party/ed_imageresizer/@
Add path variables to your config at @system/expressionengine/config/config.php@:
bc. $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
h2. Usage
h3. 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
h3. Usage example
bc. {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:
bc.