[TYPO3-english] GraphicsMagick combine on Windows

Joerg Wagner [DigiLog] news.netfielders.de at digilog.de
Mon Oct 12 18:35:15 CEST 2009


Hello Bernhard,

below you will find the print_r output.
It is obvious that the indices that are used to swap positions 
$paramsArr[count($paramsArr)-3] and $paramsArr[count($paramsArr)-4] 
point to non existent elements because the array elements are not 
numbered continuously (gaps at index 4 and 6).
Some more tracing reveals the bug:
The path I posted in all my examples (D:\myweb\) is actually faked to 
keep things short. The real path contains blanks (and this is the 
difference to your installation!).
Function unQuoteFilenames() explodes the parameter string by blanks but 
tries to do a kind of CVS explode that honors quotes within the 
parameter string and does not explode quoted params.
This function works correct, but it does not return an array with 
continuously numbered indices. And imageMagickCommand() in turn expects 
an evenly numbered array.

The solution is simple:
Change the last line of function unQuoteFilenames() from
		return $paramsArr;
to
		return array_values($paramsArr);
This creates new array with continous indices and solves the problem.

Do you want me to file the bug report or will you do it (as you have the 
power to insert the solution into the core at the same time).

Thanks again for pointing me into the right direction, Bernhard!
Cheers,
Jörg.


Array
(
     [0] => -compose
     [1] => over
     [2] => +matte
     [3] => "D:/myweb/typo3/sysext/install/imgs/greenback.gif"
     [5] => "D:/myweb/typo3/sysext/install/imgs/jesus.jpg"
     [7] => "D:/myweb/typo3temp/temp/916767b3cc02b31a0c0039f8c470956a.gif"
     [9] => "D:/myweb/typo3temp/install_44f1273ab1.jpg"
)
Array
(
     [0] => -compose
     [1] => over
     [2] => +matte
     [3] => "D:/myweb/typo3/sysext/install/imgs/greenback.gif"
     [5] => "D:/myweb/typo3/sysext/install/imgs/jesus.jpg"
     [7] => "D:/myweb/typo3temp/temp/916767b3cc02b31a0c0039f8c470956a.gif"
     [9] => "D:/myweb/typo3temp/install_44f1273ab1.jpg"
     [4] =>
)
Array
(
     [0] => -compose
     [1] => over
     [2] => +matte
     [3] => "D:/myweb/typo3/sysext/install/imgs/combine_back.jpg"
     [5] => "D:/myweb/typo3/sysext/install/imgs/jesus.jpg"
     [7] => "D:/myweb/typo3temp/temp/127cdc45dac8536e3c076875a9e95c73.gif"
     [9] => "D:/myweb/typo3temp/install_fcaf26c521.jpg"
)
Array
(
     [0] => -compose
     [1] => over
     [2] => +matte
     [3] => "D:/myweb/typo3/sysext/install/imgs/combine_back.jpg"
     [5] => "D:/myweb/typo3/sysext/install/imgs/jesus.jpg"
     [7] => "D:/myweb/typo3temp/temp/127cdc45dac8536e3c076875a9e95c73.gif"
     [9] => "D:/myweb/typo3temp/install_fcaf26c521.jpg"
     [4] =>
)




Bernhard Kraft schrieb:
> Joerg Wagner [DigiLog] schrieb:
> 
>> I also deleted any intermediate images in typo3temp/temp/
>> The install_* images are nicely recreated when I call the Install Tool
>> tests and they still contain the inverted mask - whatever settings I
>> choose for ['im_negate_mask'] and ['im_imvMaskState'].
> 
> For "GM" it doesn't matter if you set either of the flags, as soon as you go to the
> Install-Tool, you will see both flags are cleard. This is cause GM always worked
> out of the box using the following settings.
> 
> 
> I just found out the following: Your box executes the command:
> 
> gm.exe composite -compose over +matte greenback.gif jesus.jpg mask.gif output.jpg
> 
> Whereas my box (Ubuntu linux) performs the command:
> 
> gm.exe composite -compose over +matte jesus.jpg greenback.gif mask.gif output.jpg
> 
> So the "greenback.gif" and "jesus.jpg" parameters got exchanged. This happens in
> "t3lib_div::imageMagickCommand" I do currently not know why.
> 
> I also tested this in 4.2.9 and it works on my box. We could try to debug this, but
> I do not have a windows box, so you would have to do this for me:
> 
> Check out "t3lib/class.t3lib_div" and head on to function "imageMagickCommand". There
> go to the following code:
> 
> -------------------
>       if($command=='composite' && $switchCompositeParameters)  {  // Because of some weird incompatibilities between ImageMagick 4 and 6 (plus GraphicsMagick), it is needed to change the parameters order under some preconditions
>          $paramsArr = t3lib_div::unQuoteFilenames($parameters);
> -------------------
> 
> put a "print_r($paramsArr);" before and after the block
> 
> -------------------
> if(count($paramsArr)>5) {
> 	...
> }
> -------------------
> 
> And then visit the install tool combin test. At the top of the install-tool page, you'll see the
> print_r output. View the source of this frame, and send me the resulting print_r's
> 
> 
> greets,
> Bernhard


More information about the TYPO3-english mailing list