![]() ![]() > $cmd = '"COMMAND" OPTIONS "SOURCEFILE_ABSOLUTE" "TARGETFILE_ABSOLUTE"' => does not work in PHP 5.2.8, works in PHP 5.3.3 Command string similar to the install tool Please take special attention to the diffent sets of the double quotes.ġ. TARGETFILE_RELATIVE = typo3temp/pics/install_read_jpg.jpg TARGETFILE_ABSOLUTE = C:/T3demo/typo3temp/pics/install_read_jpg.jpg SOURCEFILE_RELATIVE = typo3/sysext/install/imgs/jesus.jpg SOURCEFILE_ABSOLUTE = C:/T3demo/typo3/sysext/install/imgs/jesus.jpg OPTIONS = -geometry 170x136! -colorspace RGB -quality 70 I recieved the following results, which I will simplify by using following constants for more clarity:ĬOMMAND = C:/ImageMagick-6.5.9-Q16/convert.exe $cmd = 'C: & "C:/ImageMagick-6.5.9-Q16/convert.exe" -geometry 170x136! -colorspace RGB -quality 70 "typo3/sysext/install/imgs/jesus.jpg" "typo3temp/pics/install_read_jpg.jpg"' Īfter further testing on different mashines $cmd = 'C: & "C:/ImageMagick-6.5.9-Q16/convert.exe" -geometry 170x136! -colorspace RGB -quality 70 "C:/T3demo/typo3/sysext/install/imgs/jesus.jpg" "C:/T3demo/typo3temp/pics/install_read_jpg.jpg"' īy content rendering (TypoScript, Gifbuilder, with patch 16656): After some debugging I found differences in the file locations (absolute/relative) in the command string, which ends in successfully created images or a failure without any returned value. It fixed the problem to generate images by the TYPO3 install tool, but not to create images dynamically by TypoScript and gifbuilder. $exec = '"e:/websites/misc/im/test.bat"' Also works. It works, the install_read_jpg.jpg file IS created. (I un-escaped the single-quotes after +profile parameter.) "E:/gm/gm.exe" convert +profile '*' -geometry 170x136! -colorspace RGB -quality 70 "E:/websites/misc/im/jesus.jpg" "E:/websites/misc/im/install_read_jpg.jpg" I then created test.bat file with the following content: ![]() $exec = 'E: & "E:/gm/gm.exe" convert +profile \'*\' -geometry 170x136! -colorspace RGB -quality 70 Then I tried your code under 1st bullet (with E: & dummy command). $exec = '"E:/gm/gm.exe" convert +profile \'*\' -geometry 170x136! -colorspace RGB -quality 70Į:/websites/misc/im/jesus.jpg 0 E:/websites/misc/im/install_read_jpg.jpg' Īfter putting double quotes around the output-file parameter, it doesn't work any more. (Apparently, bugtracker ate part of my previous post at the beginning.) ![]() If there is any other information I can provide, don't hesitate to ask. If removing quotes is unacceptable, I would suggest an optional global setting to disable quoting. Since I have IM and GM in environment PATH variable, calling plain convert.exe and gm.exe (unquoted!) also works.Īlthough I agree that putting an absolute & quoted path is a more "sane" (and safe) decision, I am afraid that strictly using quotes in new versions will break compatibility with earlier PHP versions (pre-5.3) (at least in combination with IIS7 on Windows). However, on PHP 5.3.3, even quoted path works (but some other issues are introduced, for instance this one - ). However, as soon as I quote the executable path (it therefore reads "E:/gm/gm.exe" instead of E:/gm/gm.exe), there is no result. This script works flawlessly (takes the jesus.jpg and creates a new install_read_jpg.jpg file). "E:/websites/misc/im/jesus.jpg" "E:/websites/misc/im/install_read_jpg.jpg"' $exec = 'E:/gm/gm.exe convert +profile \'*\' -geometry 170x136! -colorspace RGB -quality 70 I created a simple php script and ran it: I tried to isolate the issue, and apparently it lies within PHP. I'm running Windows 2008 with IIS7, php 5.2.14 (safe mode off), IM ImageMagick 6.6.5-8 Q16. However, this version introduces some other major problems with typo3 on Windows, e.g. (I can not say for sure, but if I remember correctly, using quoted path works in PHP version 5.3. Unfortunately, this prevents me from upgrading to the latest typo3 version. Calling the command with unquoted executable path works both from windows command line and from php exec(). However, calling the command from php exec() silently fails. Calling the whole command (with quoted executable) from Windows command line works (IM creates the necessary files in typo3 folder. ![]() Therefore the following command is called: For example, the path is:Į:\ImageMagick\convert.exe +profile '*' geometry 170x136! -colorspace RGB -quality 70 "E:/websites/-/typo3/sysext/install/imgs/jesus.jpg" "E:/websites/-/typo3temp/pics/install_read_jpg.jpg"Īs of version 4.5 (I tried alpha3, beta1 and beta2), quotes are put around IM executable path. In 4.4.4 and before, typo3 did not put quotes around the IM path when calling it with exec(). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |