-
Notifications
You must be signed in to change notification settings - Fork 5
generating scaled 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.
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
The filename
argument takes the name of a file (without the path) in /uploads/images
.
g image generateScaled --filename=picture.png
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