Page 1 of 1

multiple files and %[filename:...] handling.

Posted: 2011-03-07T18:48:52-07:00
by anthony

Code: Select all

  convert eye.gif news.gif storm.gif    -scale 200% \
          -set filename:f '%t_magnify.%e' '%[filename:f]'
This works, except that all three files are being saved to the first file name!
That is not a bug, it is what I would expect.

What is a bug is that the result however is NOT a 'GIF animation'.
that is each of the three images are being saved separately to the the
first file name, as separate images with separate opens/closes.

Note however, that adding '+adjoin'

Code: Select all

  convert eye.gif news.gif storm.gif    -scale 200% \
          -set filename:f '%t_magnify.%e'  +adjoin '%[filename:f]'
and we get three separate image files, as we should.

The first (-adjoin) case is incorrect, no matter how you look at it.
The second (+adjoin) is correct handling.

Re: multiple files and %[filename:...] handling.

Posted: 2011-03-07T19:50:49-07:00
by magick
We get:
  • -> convert eye.gif news.gif storm.gif -scale 200% -set filename:f '%t_magnify.%e' '%[filename:f]'
    -> identify eye_magnify.gif
    eye_magnify.gif[0] GIF 64x64 64x64+0+0 8-bit PseudoClass 8c 2.5KB
    eye_magnify.gif[1] GIF 64x64 64x64+0+0 8-bit PseudoClass 8c 2.5KB
    eye_magnify.gif[2] GIF 64x64 64x64+0+0 8-bit PseudoClass 8c 2.5KB
Isn't that the expected behavior?

Re: multiple files and %[filename:...] handling.

Posted: 2011-03-07T19:58:47-07:00
by anthony
Yes it is. Sorry it seems I didn't see the animation, because there was no -loop 0.

My bad... Thanks.

Re: multiple files and %[filename:...] handling.

Posted: 2011-03-07T20:06:44-07:00
by anthony
Hmmm but changing the suffix of the file doesn't.

Code: Select all

convert eye.gif news.gif storm.gif -scale 200% \
       -set filename:f '%t_magnify.png' +adjoin '%[filename:f]'
Saves GIF files into filenames with a .png suffix.

Code: Select all

file news_magnify.png
news_magnify.png: GIF image data, version 89a, 64 x 64

Of course I could force it by also adding a PNG: prefix...

Code: Select all

convert eye.gif news.gif storm.gif -scale 200% \
       -set filename:f '%t_magnify.png' +adjoin PNG:'%[filename:f]'