Creating multipage Tiff from file list

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Creating multipage Tiff from file list

Post by sergiokapone »

Suppose I have file list filelelist.txt

Code: Select all

C:\a\001.tiff
C:\a\002.tiff
C:\a\003.tiff
C:\a\004.tiff
C:\a\005.tiff
...
C:\a\100.tiff
I need to create from those files a single multipage tiff.

How can I make it?
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Creating multipage Tiff from file list

Post by GeeMack »

sergiokapone wrote: 2017-06-25T02:04:07-07:00Suppose I have file list filelelist.txt

Code: Select all

C:\a\001.tiff
C:\a\002.tiff
C:\a\003.tiff
C:\a\004.tiff
C:\a\005.tiff
...
C:\a\100.tiff
I need to create from those files a single multipage tiff.

How can I make it?
ImageMagick can, in most cases, read a list of input files from a prepared text file. This is done by preceding the text file's name with an "@" sign. A command to accomplish your task could be as simple as this...

Code: Select all

convert @filelist.txt output.tif
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Re: Creating multipage Tiff from file list

Post by sergiokapone »

GeeMack, thank you.
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Re: Creating multipage Tiff from file list

Post by sergiokapone »

Unfortunantly with newest version of IM I get an error

Code: Select all

convert: UnableToOpenBlob '@C:c:\Downloads\0030.tif': Invalid argument @ error/blob.c/OpenBlob/3093.
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating multipage Tiff from file list

Post by fmw42 »

convert: UnableToOpenBlob '@C:c:\Downloads\0030.tif': Invalid argument @ error/blob.c/OpenBlob/3093.
@C:c:\Downloads\0030.tif is not a text file containing your list of image files.

You need to put your list of image files into a text file. Then in your command your reference the test file as mentioned about.

Create a new text file, say, filelist.txt. In that file, paste your list of images exactly as you would access them

Code: Select all

C:\a\001.tiff
C:\a\002.tiff
C:\a\003.tiff
C:\a\004.tiff
C:\a\005.tiff
...
C:\a\100.tiff
In ImageMagick 6, you do

Code: Select all

convert @filelist.txt result.tiff
In ImageMagick 7, you do

Code: Select all

magick @filelist.txt result
If those do not work, then you may have to edit your policy.xml file to permit the use of @ for accessing text files.
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Re: Creating multipage Tiff from file list

Post by sergiokapone »

How can I modyfy my policy.xml?
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Creating multipage Tiff from file list

Post by snibgo »

sergiokapone wrote:'@C:c:\Downloads\0030.tif': Invalid argument
Please show the exact command you used. The error message suggests you mis-typed something, with "C:" twice.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating multipage Tiff from file list

Post by fmw42 »

An alternate method is to simply put all your images in a new directory. Then change directories to that directory. Then

Code: Select all

convert *.tiff newimage.tiff
Use magick rather than convert if you are on IM 7.
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Re: Creating multipage Tiff from file list

Post by sergiokapone »

I use batch file

Code: Select all

@Echo Off & CLS
::mode con:cols=80 lines=40
REM  ===== Variables Setup ==========
setLocal
set pathImageMagik=%BookShop%\ImageMagick\
"%pathImageMagik%convert" @%1 a.tif
where %1 is my filelist.txt
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Creating multipage Tiff from file list

Post by GeeMack »

sergiokapone wrote: 2017-06-25T12:34:53-07:00I use batch file

Code: Select all

@Echo Off & CLS
::mode con:cols=80 lines=40
REM  ===== Variables Setup ==========
setLocal
set pathImageMagik=%BookShop%\ImageMagick\
"%pathImageMagik%convert" @%1 a.tif
where %1 is my filelist.txt
The error you posted above shows...

Code: Select all

UnableToOpenBlob '@C:c:\Downloads\0030.tif' ...
That leads me to think your text file has errors. It looks like it's trying to find an image file with a path name that starts with "C:c:\ ...", which would pretty obviously be wrong on a Windows system.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Creating multipage Tiff from file list

Post by snibgo »

I have a vague memory that @filename.txt has a bug, and drives can't be used within filename in that file. Directories are okay, but not drives.
snibgo's IM pages: im.snibgo.com
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Re: Creating multipage Tiff from file list

Post by sergiokapone »

Possible bug?
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating multipage Tiff from file list

Post by fmw42 »

As I mentioned above:

An alternate method is to simply put all your images in a new directory, if they are not already. Then change directories to that directory. Then

Code: Select all

convert *.tiff newimage.tiff
Use magick rather than convert if you are on IM 7.
sergiokapone
Posts: 17
Joined: 2012-10-22T04:58:55-07:00
Authentication code: 67789

Re: Creating multipage Tiff from file list

Post by sergiokapone »

fmw42 wrote: 2017-06-26T09:19:25-07:00 Use magick rather than convert if you are on IM 7.
Ok.

But why in my %Temp% folder many files magick-6844AaBOq7CoiJCI apear with ~60 Mb during conversion folder with CCITTFAX4 (~10 Kb) tiff files ?

If I start to combine over 400 files, all free disk space (9 Gb) quickly disappears
Windows 10.0.14393, ImageMagick 7.0.6 0 portable Q16 x86
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating multipage Tiff from file list

Post by fmw42 »

Those files should be deleted automatically. If they do not, then there is something wrong. You can delete them. See if they get left behind again. But what was your exact command line? If you do not reference your files correctly, perhaps bogus files will be created and left in your TEMP folder. Be sure you command is correct.
Post Reply