Issue Feature Closed

#15705Cropscale for imgResources

Stefan Geith 02/23/06, 11:56 updated 08/12/06, 14:17

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 100×80px), 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 120×90px rectangle and then a 120×90px rectangle is cropped out: verticallyh centered (90c), orizontally centering moved 50% (120c-50) to the left.

(issue imported from #M2675)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.