Some times the ImageMagick convert 1 file to a few images, named by -0, -1, -2....
How can I get the number of the images? I guess there should be some variable I can use directly.
Thanks!
How to get the number of images
-
- Posts: 1
- Joined: 2015-11-27T03:11:47-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to get the number of images
try
that will give you the total number of scenes repeated for each scene. So you have to do some further processing to extract just one of them.
see http://www.imagemagick.org/script/escape.php.
For example:
or in unix you can do
Always best to provide your IM version and platform when asking question on this forum, since IM syntax and scripting differ between unix and windows.
Code: Select all
convert image -format "%n\n" info:
see http://www.imagemagick.org/script/escape.php.
For example:
Code: Select all
convert rose: rose: rose: rose: rose.gif
Code: Select all
convert rose.gif -format "%n\n" info:
4
4
4
4
Code: Select all
convert rose.gif -format "%n\n" info: | head -n 1
4