[TYPO3-english] GraphicsMagick composite inverted on Windows

hinterindien at gmx.net hinterindien at gmx.net
Mon Apr 19 09:03:44 CEST 2010


Hello all, 

I got a strange problem with GraphicsMagick running on Windows 
I'm using:
Apache Server
Typo3 4.2.12
GraphicsMagick 1.3.12-Q16
Windows XP (SP3)

localconf settings:
$TYPO3_CONF_VARS['GFX']['im_path'] = 'C:\\Programme\\GraphicsMagick-1.3.12-Q16/';	
$TYPO3_CONF_VARS['GFX']['im_version_5'] = 'gm';	
$TYPO3_CONF_VARS['GFX']['im_path_lzw'] = '';
$TYPO3_CONF_VARS['GFX']['TTFdpi'] = '96';
$TYPO3_CONF_VARS['GFX']['gdlib_2'] = '1';
$TYPO3_CONF_VARS['GFX']['imagefile_ext'] = 'gif,jpg,jepg,tif,bmp,pcx,tga,png,pdf,ai,svg';

If I run the image processing tests in the install tool, I find, that tests no. 4 (combining images) and 5 (GD library functions) fail. 

The most obvious deviation from the expected behavior is the wrong masking in the first example on test no. 4: The green mask is on the upper half. Playing with im_negate_mask/im_imvMaskState as indicated in the help-text doesn't change anything, because these flags are not active for im_version_5 = gm.

Debugging the problem, I found that the gm-Commands are processed by imageMagickCommand in t3lib_div. In case of a composite/combine-command, the command is further processed to change the order of parameters if necessary. This is done in t3lib_div, unQuoteFilenames.

Strange enough, this gives weird results in my case, because my system generates (out of reasons unknown to me) the file parameters in double quotes: 
They look like this: 
C:\...gm.exe composite -compose over +matte 
"E:/path../jesus.jpg" 
"E:/path../greenback.gif" 
"E:/path../mask.gif" 
"E:/path../install_44f1273ab1.jpg"

The function "unQuoteFilenames" is obviously written to deal with spaces in the path. But the simple case of no spaces in the path AND double quotes around it is handled wrong. 

I could correct the problem by changing the line 

elseif(ereg('^"', $v))

to: 

elseif(ereg('^"', $v) && !ereg('"$', $v))

- and now everything works fine!

(the first line tries to find lines starting with double quotes. The corrected line just ignores lines that end with double quotes, too)

Now I got two questions:

It seems not to be common that Windows (or who else) puts double quotes around file paths, because I didn't find anybody else having the same problem. Is there maybe a setting that I have to change?

If not - should I report a bug? Where? How? And, if reporting a bug, shouldn't I use the chance an replace the deprecated "ereg" by something else?

Thanks for your interest and help
Nicolai


More information about the TYPO3-english mailing list