Issue Feature Closed

#15403Add cropscale to imgResources

Stefan Geith 01/13/06, 16:41 updated 02/23/06, 14:32

Description

With ‘cropscale’ images are scaled to a size, that encloses the width/height box; After scaling, a centered portion of the image with size = width/height is cropped out.

Cropscale ensures, that the image created always has exactly the dimensions width/height, but left/right-or top/bottom-part is cut off.

I created the extension ‘sg_cropscale’, that extends tslib_gifbuilder via XClass (functions imageMagickConvert and getImageScale).
Now the properties ‘width’ and ‘height’ of ‘imgResource’ can have a ‘c’ after it, what indicates ‘cropscale’.

And two new properties (cropV and cropH) have been introduced where I can set if cropping is centered or left/top aligned:
file.cropH=-100 (left-aligned) | 0 (centered) | 100 (right aligned)
file.cropV=-100 (top-aligned) | 0 (centered) | 100 (bottom aligned)
These are percentage values and so the cropping can be moved somewhat to the top (e.g. cropV=-50) or to the right (cropH=33)…

The plugin can be found here:
http://typo3.org/extensions/repository/search/sg_cropscale/

I am not familiar with diff :(
but I marked all changes with comments in the file class.ux_tslib_gifbuilder.php and appended it.

I hope, a core developper finds the time to do the patch or include it directly to the core.
(issue imported from #M2252)

Reviews 0

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