ImpressCMS (1.2 Upwards) can resize images automatically if you tell it what images and where to put them. You just need to insert a Smarty tag in your design where you want the resized image to be.
UPDATED: You can download an updated version of this plugin (1.11, december 22, 2010), including some bugfixes.
Note: You can find updated info on the ImpressCMS Wiki.
resized_image resizes an image to the specified size and returns a formatted HTML tag pointing to the resized copy.
Example:
<{resized_image file="full_path_to_the_file" height=xxx width=xxx fit="foo"}>It automatically checks if the original image has changed, and rebuilds the resized copy when needed. It stores those resized copies in the 'cache' folder.
-file : file (and path) of image (required)
-height : image height (optional, default actual height)
-width : image width (optional, default actual width)
- return : (optional) 'url' returns the URL of the resized image. 'img' returns a full built IMG tag. Defaults to 'img'.
-basedir : base directory for absolute paths, default is environment variable DOCUMENT_ROOT
-path_prefix : prefix for path output (optional, default empty)
-fit : The way the image is resized. Possible values:
You don't depend on a module's ability to resize images anymore, and you don't need to have GD2 or ImageMagik installed in your host. It uses internal iCMS core components to do the job.
The plugin reports any problem found whenever possible. If you have problems, activate debug console and reload the page. There should be an error message referring the problem.
You can add thumbs and Suppose you have a photo gallery and you decide to change the thumbnail and medium size. You just have to change the tag code and you're done.
| Attachment | Size |
|---|---|
| function.resized_image.1-11.zip | 2.79 KB |
Post new comment