Imagemagick getting stuck while converting tif file.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Imagemagick getting stuck while converting tif file.
I expect it also needs -draw "alpha ... floodfill" rathe than -draw "matte ... floodfill". Matte is deprecated in IM 7 and replaced by alpha in one form or another.
Re: Imagemagick getting stuck while converting tif file.
Dear all,
Unfortunately I am back again!
Thanks to Fred's help, using "magick ..." worked a lot better than "magick convert..."
However, magick is is still stuck sometimes and the following trick is still needed manually:
magick filein001.tif flein002.tif filein003.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
instead of
magick filein*.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
Well, sometimes, doing "sh .\script.bat" helps too but not this time. The failure is very consistant with
the input files. (where "sh" is mks shell)
Well, I have about 1-5 stuck cases like this in 100 file converts, in the same batch file.
(B4 it was much worse at about 15-20 cases per 100 converts)
Any ideas?
Thank you!
PhotoCat
-----------
recap:
I have experienced the same problem during tif conversion and I have found a workaround!
My command line is: (in win7 x64)
magick convert filein*.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
and it sometimes gives me an error message: (sometimes but not always)
"Imagemagick Studio Library and utility programs has stopped working"
Doing the following manual expansion helps sometimes:
magick convert filein001.tif flein002.tif filein003.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
end of recap
Unfortunately I am back again!
Thanks to Fred's help, using "magick ..." worked a lot better than "magick convert..."
However, magick is is still stuck sometimes and the following trick is still needed manually:
magick filein001.tif flein002.tif filein003.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
instead of
magick filein*.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
Well, sometimes, doing "sh .\script.bat" helps too but not this time. The failure is very consistant with
the input files. (where "sh" is mks shell)
Well, I have about 1-5 stuck cases like this in 100 file converts, in the same batch file.
(B4 it was much worse at about 15-20 cases per 100 converts)
Any ideas?
Thank you!
PhotoCat
-----------
recap:
I have experienced the same problem during tif conversion and I have found a workaround!
My command line is: (in win7 x64)
magick convert filein*.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
and it sometimes gives me an error message: (sometimes but not always)
"Imagemagick Studio Library and utility programs has stopped working"
Doing the following manual expansion helps sometimes:
magick convert filein001.tif flein002.tif filein003.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
end of recap
Re: Imagemagick getting stuck while converting tif file.
more updates:
ran it with 236 command lines in a batch file. 8 files failed.
Then I re-ran it with just these 8 files in a new batch file, only 1 failed.
Re-ran the last file again and again and it consistantly failed.
So I had to manually do the * expansion and it worked. It is really weird and prevents fully automatic batch operation.
Any ideas? Tks!
ran it with 236 command lines in a batch file. 8 files failed.
Then I re-ran it with just these 8 files in a new batch file, only 1 failed.
Re-ran the last file again and again and it consistantly failed.
So I had to manually do the * expansion and it worked. It is really weird and prevents fully automatic batch operation.
Any ideas? Tks!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imagemagick getting stuck while converting tif file.
What version of IM are you using?
Perhaps it is a memory problem. How many pixels are in filein*.tif?
Perhaps it is a memory problem. How many pixels are in filein*.tif?
snibgo's IM pages: im.snibgo.com
Re: Imagemagick getting stuck while converting tif file.
Tks snibgo for your reply.
The version is:
C:\Program Files\ImageMagick-7.0.1-Q16/magick.exe
the .tif file dimension is 3608x5409, a 1-bit bw image file.
the .tif file size is about 95Kb.
Tks a lot!
The version is:
C:\Program Files\ImageMagick-7.0.1-Q16/magick.exe
the .tif file dimension is 3608x5409, a 1-bit bw image file.
the .tif file size is about 95Kb.
Tks a lot!
Re: Imagemagick getting stuck while converting tif file.
but all the 200+ tif files are of the same dimension. Many went thru ok. Tks
Re: Imagemagick getting stuck while converting tif file.
I used the following command to convert the source jpg file to the 1-bit tif file:
magick infile.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 outfile.tif
magick infile.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 outfile.tif
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Imagemagick getting stuck while converting tif file.
Can you post a link to your tif file so others can test? How up-to-date- is your libtif?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imagemagick getting stuck while converting tif file.
Hmm. 200 images, each 3608x5409 pixels. At Q16, v6 will need 8 bytes/pixel for each image. For grayscale, I think v7 needs only 2 bytes per pixel. 3608x5409x2x200 = 7.8 GB. That might be a problem for your computer. What does Task Manager say about memory usage?
True, IM shouldn't just fall over if it runs out of memory. It should simply use disk instead, which is far slower.
True, IM shouldn't just fall over if it runs out of memory. It should simply use disk instead, which is far slower.
snibgo's IM pages: im.snibgo.com
Re: Imagemagick getting stuck while converting tif file.
I don't think we need to count all 200 images, as they are all sequentially done in a batch file, one at a time, unless u have a memory leak.
I am not comfortable posting the tif files publicly as they are copyrighted music scores which our church has purchased many hardcopies as
well as paid yearly subscriptions to obtain the right to copy the music scores for internal use.
However, I think I am comfortable emailing them privately to either snibgo or Fred who are most honorable, for testing purposes only. Let me know how u want to receive them. Tks a lot!
I am not comfortable posting the tif files publicly as they are copyrighted music scores which our church has purchased many hardcopies as
well as paid yearly subscriptions to obtain the right to copy the music scores for internal use.
However, I think I am comfortable emailing them privately to either snibgo or Fred who are most honorable, for testing purposes only. Let me know how u want to receive them. Tks a lot!
Last edited by PhotoCat on 2016-08-05T05:46:58-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imagemagick getting stuck while converting tif file.
I'm confused. Previously, you said:PhotoCat wrote:I don't think we need to count all 200 images, as they are all sequentially done in a batch file, one at a time, unless u have a memory leak.
Which is it? If there is one input file per convert command, no problem. But 200 will be a problem unless you have masses of memory.PhotoCat wrote:My command line is: (in win7 x64)
magick convert filein*.tif -units PixelsPerInch -page Letter -density 72 fileout.pdf
snibgo's IM pages: im.snibgo.com
Re: Imagemagick getting stuck while converting tif file.
oh... how do u check if the libtif is up-to-date? tks!
Re: Imagemagick getting stuck while converting tif file.
just 1-20 input files per command line.
I have 200+ commnad lines in total. sorry for confusion.
I have 200+ commnad lines in total. sorry for confusion.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imagemagick getting stuck while converting tif file.
So each output PDF has only about 20 input TIFF images, correct? And you create about 200 PDFs, presumably with different combinations of TIFFs for different singers or whatever. Yes?
It might help if you posted your command file.
It might help if you posted your command file.
snibgo's IM pages: im.snibgo.com
Re: Imagemagick getting stuck while converting tif file.
yes, each output PDF has a maximum of 20 input files (the biggest I have seen is 12 input tif files)
I am trying to combine a multi page music score from many different jpg files (1 page each) into one multi-page pdf file.
I don't think we need to think about the big big command file containing 200 lines because one small command file will crash magick.
Here is the simple command file (named run.bat) that will crash magick: (note the song name is in Traditional Chinese)
In this case the music score has 2 pages.
run.bat
=========
magick 558.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481藉我賜恩褔001.tif && echo multiplepage
magick 559.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481藉我賜恩褔002.tif && magick 481藉我賜恩褔*.tif -units PixelsPerInch -page Letter -density 72 481藉我賜恩褔.pdf
I am trying to combine a multi page music score from many different jpg files (1 page each) into one multi-page pdf file.
I don't think we need to think about the big big command file containing 200 lines because one small command file will crash magick.
Here is the simple command file (named run.bat) that will crash magick: (note the song name is in Traditional Chinese)
In this case the music score has 2 pages.
run.bat
=========
magick 558.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481藉我賜恩褔001.tif && echo multiplepage
magick 559.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481藉我賜恩褔002.tif && magick 481藉我賜恩褔*.tif -units PixelsPerInch -page Letter -density 72 481藉我賜恩褔.pdf