Hi,
I want to get the number of pages from a TIF using command line.
I know there's the component identify.exe but I don't find the parameters to apply.
I need to get the number of pages into a variable.
Thanks for any help
Antoine
How to get the number of pages from a TIF?
-
- Posts: 6
- Joined: 2015-07-21T02:45:54-07:00
- Authentication code: 1151
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to get the number of pages from a TIF?
One method:
This will output (n) lines, one per image. Each line will contain the number (n). Grab any of those into a variable. See http://www.imagemagick.org/script/escape.php
There may be a single-line solution, but I can't find one.
Code: Select all
identify -ping -format %n\n multi.tiff
There may be a single-line solution, but I can't find one.
snibgo's IM pages: im.snibgo.com
-
- Posts: 6
- Joined: 2015-07-21T02:45:54-07:00
- Authentication code: 1151
Re: How to get the number of pages from a TIF?
I tried this method but I don't know how to put the result in a variable...
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to get the number of pages from a TIF?
ImageMagick won't put it into a variable. Your script needs to do that.
snibgo's IM pages: im.snibgo.com
- 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 pages from a TIF?
What platform and what version of IM. If Unix, then
Code: Select all
number=$(identify -ping -format "%n\n" multi.tiff | tail -n -1)