[TYPO3-english] Typoscript if => maxW cropped.

Sergey Alexandrov serg at alexandrov.us
Wed Feb 2 23:10:45 CET 2011


I usually re-scale and crop an image to pre-defined size with this:

file.width = 180c-100
file.height=120c-100

this way image will be re-sized/cropped to 180x120, from left-top corner

On 2/2/2011 5:00 PM, Loek Hilgersom wrote:
> Hi,
>
> Certainly possible. Try this:
>
> Remove this part:
>
> 10.file.minH = 120
> 10.file.maxH = 120
> 10.file.maxW = 180
>
> and replace by:
>
> 10.file.height = 120
> 10.file.width = 180c
>
> If the result is not exactly what you want (portrait orientation may 
> come out different from what you want), then you could do a 2 step 
> resize:
> first create an IMAGE object which resizes to height = 120,
> then feed that into a new object that crops width at 180.
>
> See tsref for these c and m options for height and width.
>
> Hth.
> Loek
>
>
> On 02/02/2011 12:25 PM, Koen Van Nuffelen wrote:
>>
>> Hi,
>>
>> I'm searching for the following solution in Typoscript:
>>
>> I can set the minW & maxW and maxH for an image, which is fairly easy:
>>
>> 10 = IMAGE
>> 10.file.import = uploads/tx_templavoila/
>> 10.file.import.current = 1
>> 10.file.import.listNum = 0
>> 10.file.minH = 120
>> 10.file.maxH = 120
>> 10.file.maxW = 180
>>
>> The more difficult (if it's even possible with typoscript) part is this:
>> After the resize to maxH,
>> I want to do a check if the image width is still above 180
>> and if yes then crop the width to 180 (180c)
>>
>> Is this possible in Typoscript and if so, how to solve?
>> Any hints or tips?
>>
>> Kind regards,
>> Koen Van Nuffelen
>>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list