To start with, I have an old system with WinXP on it, so I'm using this release;
ImageMagick-7.0.8-59-portable-Q16-x86.zip
I've been trying to write a script that will go through a directory full of unknown image files and rename them based on their actual width. Since the directory may contain GIF files with multiple frames, the only reliable way to get the width is to tell it to only look at the first frame. Otherwise the width might be reported as "450450450450450", etc. The problem is that the command line fails if the filename happens to contain "%%" and you include the option to only check the first frame.
For example, these work;
Code: Select all
Identify -format %w "Test.gif"[0]
Identify -format %w "Test.gif[0]"
Code: Select all
Identify -format %w "T%%est.gif"
Code: Select all
Identify -format %w "T%%est.gif"[0]
Identify -format %w "T%%est.gif[0]"
Code: Select all
Identify -format %w "T%%%est.gif"[0][/b]
Identify -format %w "T%%%est.gif[0]"[/b]
I'm inclined to consider this a bug since it has no problem with the filename when you omit "[0]", no matter what (legal) characters it contains. I wouldn't think that a parameter (flag, whatever) to tell it to only look at the first frame of a file would change how it handles the filename.