Using the "*" character: order of images
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Using the "*" character: order of images
Suppose I have a set of tif images called p1.tif, p2.tif... p25. tif. If I type convert p*.tif mybook.pdf, how does ImageMagick choose the order of these images in the pdf result? Is it the same order you obtain when you type dir p*.tif in a command prompt window? Can I influence this order?
Re: Using the "*" character: order of images
'*' is resolved by your shell, not ImageMagick. So, yes, it should be the same order as it is returned by 'dir p*.tif'. This order will be different on various systems, various shells etc.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Using the "*" character: order of images
I don't know if IM has a built-in method for specifying the order of input files called with wildcards. I don't think it has, but some more qualified experts might weigh in. There are some fairly simple ways to get your files into IM in a particular order, but the specifics depend on your operating system and possibly the version of IM you're using. You should always provide those when asking questions to get the best answers.Jean-Pierre Coulon wrote:Suppose I have a set of tif images called p1.tif, p2.tif... p25. tif. If I type convert p*.tif mybook.pdf, how does ImageMagick choose the order of these images in the pdf result? Is it the same order you obtain when you type dir p*.tif in a command prompt window? Can I influence this order?
I'm using ImageMagick 7.0.3 on a Windows 10 system, so a simple way to specify the order of input files is to do a directory listing in my preferred order and redirect it to a text file. Recent versions of ImageMagick will read the input names from that file by prefixing the file name with a "@". Let's say the list of images is in a file named "imagelist.txt", the command would start with something like this...
Code: Select all
magick @imagelist.txt -resize 640x480 ...
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Using the "*" character: order of images
It's often useful to use leading zeros, so the files are called p01.ti, p02.tif... p25.tif. That way, an alphabetic order can be used.Jean-Pierre Coulon wrote:... a set of tif images called p1.tif, p2.tif... p25. tif.
snibgo's IM pages: im.snibgo.com
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Re: Using the "*" character: order of images
Thanks, it works well with leading zeroes. I am with Windows 10. The order in the pdf is that obtained with dir/on p*.tif.
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Re: Using the "*" character: order of images
Thanks, it works well with leading zeroes. I am with Windows 10. The order in the pdf is that obtained with dir/on p*.tif.