Page 1 of 2

Creating multipage Tiff from file list

Posted: 2017-06-25T02:04:07-07:00
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?

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T07:51:37-07:00
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

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T10:41:43-07:00
by sergiokapone
GeeMack, thank you.

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T11:50:37-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T12:03:09-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T12:08:55-07:00
by sergiokapone
How can I modyfy my policy.xml?

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T12:19:10-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T12:23:06-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T12:34:53-07:00
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

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T14:13:22-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-25T14:22:52-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-26T00:21:16-07:00
by sergiokapone
Possible bug?

Re: Creating multipage Tiff from file list

Posted: 2017-06-26T09:19:25-07:00
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.

Re: Creating multipage Tiff from file list

Posted: 2017-06-26T10:36:41-07:00
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

Re: Creating multipage Tiff from file list

Posted: 2017-06-26T10:56:25-07:00
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.