Page 3 of 3
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-04T20:38:54-07:00
by PhotoCat
Note the conversion to .tif never crash. It always crashes on the multiple page conversion to pdf.
i.e.
magick 481藉我賜恩褔*.tif -units PixelsPerInch -page Letter -density 72 481藉我賜恩褔.pdf
Thank you for looking into this snibgo! Really appreciated!
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-04T20:56:40-07:00
by fmw42
PhotoCat wrote:oh... how do u check if the libtif is up-to-date? tks!
convert -list format
should tell you the version of libtif, e.g
TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF,
Version 4.0.6)
My guess is that your use of wildcards is either grabbing too many images for your memory or that you are running out of temp space in your /tmp directory or whatever is the equivalent on Windows.
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-04T21:07:19-07:00
by snibgo
I don't know what the problem is. I suggest you try:
(1) Split into separate commands, without "&&":
Code: Select all
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
(2) Use names with only ASCII characters:
Code: Select all
magick 558.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481_A_001.tif
echo multiplepage
magick 559.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481_B002.tif
dir 481_*.tif
magick 481_*.tif -units PixelsPerInch -page Letter -density 72 481_out.pdf
I include "dir 481_*.tif" to check for any other files named like that.
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-05T05:43:53-07:00
by PhotoCat
1) tried this:
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
results: the last line crashed again. (same as before)
2) changed to this:
magick 558.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481blessings_come_from_God001.tif
echo multiplepage
magick 559.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481blessings_come_from_God002.tif
magick 481blessings_come_from_God*.tif -units PixelsPerInch -page Letter -density 72 481blessings_come_from_God.pdf
results: wow! it worked! Not only did it work but the computation speed is much much faster for all commands, not just the last command!
Thank you so much snibgo for identifying the problem! What can I do to keep the chinese unicode names though? tks!
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-05T06:17:14-07:00
by snibgo
Excellent. You have a workaround. You can rename files before IM sees them, and rename them back afterwards.
There may be a bug in the way IM handles wildcards, when using UTF-8. I almost never use non-ASCII characters, so I don't encounter the problem.
I've reported this as a possible bug:
viewtopic.php?f=3&t=30248
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-05T06:52:12-07:00
by PhotoCat
Thank you so much snibgo for your help. Indeed it would not be too difficult to incorporate the renaming process in the scripts as a workaround.
Thanks you everyone once again and thank you for the amazing magick tool!
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-05T20:11:21-07:00
by PhotoCat
More info for the developers:
I have found out that this would work:
---------------------
magick 558.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481blessings_come_from_God001.tif
echo multiplepage
magick 559.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481blessings_come_from_God002.tif
magick 481blessings_come_from_God*.tif -units PixelsPerInch -page Letter -density 72 481blessings_come_from_God.pdf
---------------------
but the following won't:
---------------------
magick 558.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481blessings_come_from_God001.tif
echo multiplepage
magick 559.jpg -colorspace Gray -type Grayscale -depth 1 -compress group4 481blessings_come_from_God002.tif
magick 481blessings_come_from_God*.tif -units PixelsPerInch -page Letter -density 72 481藉我賜恩褔.pdf
----------------------
So not only does magick crash while handling wild cards with unicode, but it also fails if the output filename is unicode. (as least in Chinese)
Thanks!
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-05T21:45:20-07:00
by fmw42
Are you sure your output name has proper UTF-8 characters? Some foreign characters look fine but are not proper UTF-8
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-06T06:37:59-07:00
by PhotoCat
Not 100% sure as I don't know how to test it for true UTF-8 compliance but I can rename a folder using the same characters.
Windows 7 & 10 seem to take it ok. I can also see the same characters on DOS prompt. Put it in MSWord and it prints well.
It also seems to display well in Notepad++ which has a good reputation of handling unicode characters. Also displays well in plain Notepad.
The characters also display well on google drive and on android phones and tablets so the chance is high that the characters are ok.
I know what u mean for some old big5 Chinese encoding etc, that requires some special s/w to view them properly. Not in my case here.
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-06T10:59:29-07:00
by fmw42
I do not know if Notepad is UTF-8 compatible. I would recommend you use Wordpad. Or some UTF-8 compatible text editor.
But to test, try putting your characters in a label: command and see if IM prints them fine in the output image.
Code: Select all
convert -background white -fill black -pointsize 36 label:"your_characters_here" result.gif
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-06T16:33:19-07:00
by PhotoCat
Thank you Fred for the pointer. Appreciated it!
ok, used this command:
magick -background white -fill black -pointsize 36 label:"481藉我賜恩褔" result.gif
and the gif file reads 481?????
I guess this is not a good sign eh?
tried some other text that passed: 403數算主恩
It came out 403????
Tried many other characters I have used and it all turned out "?????" in the gif file again.
But they had all worked! Mmm...
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-06T17:08:16-07:00
by PhotoCat
btw, I think I have got the TIFF library ok: (tks Fred once again!)
magick -list format | grep TIFF
TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.6)
TIFF64* TIFF rw- Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.6)
Re: Imagemagick getting stuck while converting tif file.
Posted: 2016-08-06T20:36:58-07:00
by fmw42
You need to create your characters in a UTF-8 compatible text editor using a UTF-8 compliant font. Check in Wordpad to see if it is in UTF-8 compatible mode. Then copy and paste those characters from your text editor to your CMD window in the label: field.