Archival repost — originally published on my old blog on July 13, 2011. Translated from French, lightly cleaned up for dev.to. eZ Publish has since been rebranded/rebuilt as Ibexa DXP, but the image.ini filter mechanism and the underlying ImageMagick flags below are unchanged.
eZ Publish's default filters don't let you crop images down to precise dimensions. The image.ini config file lets you hook into eZ Publish anything the ImageMagick CLI tools can do.
Here are two filters that do the same job — crop and resize an image to an exact size — in two different ways. Use whichever fits your image aliases:
Filters[]=geometry/thumbnailize=-thumbnail "%1x%2^" -gravity center -extent %1x%2
Filters[]=geometry/thumbnailize2=-geometry %1x%2^ -gravity center -crop %1x%2+0+0 +repage
Top comments (0)