Feature #15705
closedCropscale for imgResources
0%
Description
This is a patch for the file t3lib/class.t3lib_stdgraphic.php that modifies the functions imageMagickConvert() and getImageScale() to allow cropscale.
In opposite to standard scaling with maxwidth and maxheight (e.g. by .width=100m and .height=80m) where the image is scaled to fit into a rectangle (in this case 100x80px), cropscale (e.g. .width=100c and .heigth=80c) will scale to fit around the rectangle and then crop out a centered rectangle.
The last step (cropping out a centered rectangle) can further be modified by moving the centered position to the top/left (0 ... -100%) or bottom/right (0 .. 100%).
Syntax is (for example):
file = image.jpg
file.width = 120c-50
file.height = 90c // same as 90c0
This means, that image.jpg is scaled to fit around a 120x90px rectangle and then a 120x90px rectangle is cropped out: verticallyh centered (90c), orizontally centering moved 50% (120c-50) to the left.
(issue imported from #M2675)
Files
Updated by Stefan Geith over 18 years ago
For further explanation see this example:
http://www.geithware.de/test/cropscale.html