Skip to content

generating scaled images

David Spreekmeester edited this page Jul 26, 2016 · 2 revisions

Generating images

Every uploaded image has multiple scaling templates, defined in application/configs/assets.ini. You can create your own scaling template, setting proportions and cropping. Every uploaded image will be scaled to all configured image templates. When you create a new template, you will have to generate the missing scaled images of the existing uploaded images.

Generate all missing images

On the commandline, use the default command to generate the missing ones.

g image generateScaled 

This will take the source image (locally or on a file storage service like Amazon S3), generate the scaled versions, and write them back to wherever the source file is hosted.

By default, this will not overwrite existing scaled images. If you want to overwrite existing ones with a correction, you can use the --overwrite option:

g image generateScaled --overwrite

Generate scaled versions of a specific image

The filename argument takes the name of a file (without the path) in /uploads/images .

g image generateScaled --filename=picture.png

Generate scaled versions for a specific scaling template

Especially after defining a new scaling template in application/configs/assets.ini, you will need to generate the scaled images for all the existing uploads. You can tell the scaler to only process the new template, instead of traversing all the uploads for all the templates.

g image generateScaled --template=medium_square
Clone this wiki locally