[TYPO3-dev] CropScale in imgResource

Stefan Geith typo3dev at geithware.de
Fri Jan 13 15:45:22 CET 2006


Martin Kutschker schrieb:
> Stefan Geith schrieb:
>> Martin Kutschker schrieb:
>>
>>> Stefan Geith schrieb:
>>>
>>>> Wouldn't this be nice to have in the core ?
>>>
>>> Yes, have missied it already on some occasions.
>>>
>>> But I want to have the alignment of cropped images configurable:
>>>
>>> cropVertAlign = top|center|bottom
>>> cropHorAlign = left|center|right
>>
>> I would suggest
>>    cropV = -100...100
>>    cropH = -100...100
>>
>> Values are percentage:
>> -100 = top/left
>>    0 = centered
>>  100 = bottom/right
> 
> Percentage of what? Of the target image size or the size of the cropped 
> image?

Percentage of how mucht to move the scaled (but not cropped) image
to the according borders.

Example:
Imagesize = 400x300px
width/height = 200c x 100c
Scaled Image is 200x150px
- CropH now doesn't matter, because the width is already 200px
- Set CropV to 0 to cut 25px at the top and 25px at the bottom
- Set CropV to -50 to cut 12px at the top and 38px at the bottom

> 
> But I think that it doesn't make much sense. Simpler is a pixel offset 
> from the border. A positive offset is from top/left a negative from 
> bottom/right. 0 means center!

No, a pixel offset doesnt work, because you don't know,
wether width or height has to be cropped;
And you do not know, how many pixels are available to crop ...

> 
> Masi
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
> 





More information about the TYPO3-dev mailing list