[TYPO3-core] RFC #8878: Bug: Fix cropscale behaviour for transparent GIF

Felix Buenemann Felix.Buenemann at googlemail.com
Mon Aug 23 09:21:50 CEST 2010


Am 10.08.10 14:59, schrieb Felix Buenemann:
> Am 10.08.10 01:38, schrieb Felix Buenemann:
>> Jigal van Hemert<jigal at xs4all.nl> wrote:
>>> On 16-7-2010 17:28, Felix Buenemann wrote:
>>>> Problem:
>>>> When using cropscale on an image with transparent background, the
>>>> parameters for cropping differ between im4 and im6, due to how they
>>>> handle the transparent canvas. This leads to incorrect cropping when
>>>> using im5 or im6.
>>>>
>>>> Solution:
>>>> Adapt behaviour according to im_version_4 flag and revert to pre
>>>> #8025
>>>> behaviour when im5/6 are used.
>>>
>>> The '!' flag for cropping was introduced with ImageMagick version
>>> 6.2.4-6 [1]. So for earlier versions of IM6 and IM5 this will not
>>> work.
>>>
>>> Because TYPO3 4.5 will support IM4,5 and 6 I don't think this will be
>>> the right solution :-(
>>>
>>> [1] http://www.imagemagick.org/Usage/crop/#crop_viewport
>>
>> I'll try to come up with a solution that works across the board...
>
> Argh, this is going to be painful...
>
> I have so far tested IM Versions
> 4.2.9/5.1.1/5.4.9/5.5.7/6.0.0/6.1.9/6.2.4/6.4.6 (what a pain getting all
> those to build on x86_64 mac)
>
> Results:
> 4.2.9-6.0.0 will work correctly without !
> 5.4.9-6.0.0, 6.2.4-6.x.x will work correctly with !
>
> Alternatively we could use -repage, but it is not implemented in 6.0.0
> and buggy in 6.0.8, but works fine in 6.1.9-6.x.x ...
>
> So it's very hard to find a solution that works with all 6.x versions,
> due to the numerous bugs.

I don't think there is a single invocation solution that works across 
all imagemagick versions. How about adding another ImageMagick install 
tools flag for ImageMagick 6.2.4+ and use different crop syntax if it is 
set?

This will leave some versions of 6.0.x-6.1.x with wrong behaviour, but I 
think it's the best we can do.


More information about the TYPO3-team-core mailing list