Hi again,
I did some more digging in the dirt (after the server slowed down again, trying to churn through several rubbish gm commands . . .
Failing gm example commands (as snipped from ps output):
gm convert -geometry 240x161! -colors 64 fileadmin/10th_anniversary/Memorial Anniversary 002.png\[0\] typo3temp/pics/a733efa5c4.png
gm convert -geometry 110x74! -colors 64 fileadmin/10th_anniversary/Memorial Anniversary 002_600px.png\[0\] typo3temp/pics/1cd7a9a68c.png
gm convert -geometry 110x74! -colorspace RGB -quality 70 fileadmin/10th_anniversary/Memorial Anniversary 002_600px.jpg\[0\] typo3temp/pics/65180b628c.jpg
http://www.imagemagick.org/script/command-line-processing.php
The use of [0] in thumbs.php is to select the first frame of a multiframe image. Usage of this parameter should be controlled by:
$TYPO3_CONF_VARS['GFX']['im_noFramePrepended']
Boolean. If set, the [x] frame indicator is NOT prepended to filenames in stdgraphic. Some IM5+ version didn't work at all with the typical [0]-prefix, which allow multipage pdf's and animated gif's to be scaled only for the first frame/page and that seriously cuts down rendering time. Set this flag only if your ImageMagick version cannot find the files. Notice that changing this flag causes temporary filenames to change, thus the server will begin scaling images again which were previously cached.
The correct usage of the frame parameter (since *nix interprets the brackets as shell commands) is:
- convert 'images.gif0' image.png
- convert 'images.gif[0-4]' images.mng
- convert 'images.gif[3,2,4]' images.mng
Also valid are:
- convert 'i m a ges.gif0' image.png
- convert 'i m a ges.gif[0-4]' images.mng
- convert 'i m a ges.gif[3,2,4]' images.mng
As are:
- convert "i m a ges.gif0" image.png
- convert "i m a ges.gif[0-4]" images.mng
- convert "i m a ges.gif[3,2,4]" images.mng
Frames should work for both IM and GM: http://www.simplesystems.org/RMagick/doc/imusage.html
phew
:-)
So the [0] in the thumbs.php is good for something after all. It is also in the right place (inside the call to wrapFileName).
It is however not dependant on the value of $TYPO3_CONF_VARS['GFX']['im_noFramePrepended']
Note that this impies that the function imageMagickIdentify() in t3lib/class.t3lib_stdgraphic.php does NOT correctly use the frame (places it outslide of the quotes):
$cmd = t3lib_div::imageMagickCommand('identify', $this->wrapFileName($imagefile).$frame);
time passes
After debugging with a nice large and wide errorGif . . . it turns out that the actual $cmd passed to exec() looks fine and dandy!
But: http://nl2.php.net/manual/en/function.exec.php reads:
'With safe mode enabled, the command string is escaped with escapeshellcmd(). Thus, echo y | echo x becomes echo y \| echo x.'
. . . and . . . thus . . . it comes out . . . unquoted . . . looking like:
- convert i m a ges.gif\[0\] image.png
- convert i m a ges.gif\[0-4\] images.mng
- convert i m a ges.gif\[3,2,4\] images.mng
But why unquoted?