[TYPO3-core] RFC #16656 : bug : ImageMagick does not work with quotes in exec() path on Windows
Jigal van Hemert
jigal at xs4all.nl
Tue Dec 21 14:40:43 CET 2010
Hi,
On 21-12-2010 14:21, Helmut Hummel wrote:
> Am 20.12.2010 17:02, schrieb Jigal van Hemert:
>> On 20-12-2010 16:20, Jeff Segars wrote:
>>> If the current, simpler approach is decided to be the right one you have
>>> my +1 on reading and +0.5 on testing that it doesn't break anything
>>> outside Windows.
>>
>> Thanks for the review!
>>
>> Any core dev with a +0.5 on testing? ;-)
> Could this be solvew differntly by using escapeshellcmd instead of
> escapeshellargs (see http://bugs.typo3.org/view.php?id=16755)?
It's not related to escapeshellargs/escapeshellcmd.
The problems are:
1. there are installations with spaces in paths to im/gm and/or the
images; these need quotes around those paths
2. PHP < 5.3 on Windows has a bug calling the command line processor if
there are multiple quotes in the command
There is no chance that this will get fixed in PHP, because recently the
last version for 5.2.x has been released.
The easiest workaround *) for this specific combination is to add a
dummy command. Now something like
"C:\path to\gm.exe" convert "D:\path to\image.jpg" "D:\path\to
other\image.jpg"
becomes
C: & "C:\path to\gm.exe" convert "D:\path to\image.jpg" "D:\path\to
other\image.jpg"
This is handled correctly by exec().
NB Only PHP versions lower than 5.3.0 on Windows are affected! The patch
only adds the dummy command in these cases.
*) General workarounds I found were:
- use short (8.3 DOS) names; this is not active by default on recent
Windows (server) versions
- use a batch file with the complex command inside; this adds more
complexity (creating files, cleaning up afterwards, etc.)
- add a dummy command in front of the actual command
--
Kind regards / met vriendelijke groet,
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
More information about the TYPO3-team-core
mailing list