Page 1 of 1

ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T00:41:44-07:00
by kolRn
Hello, guys!
First, I would like to thank you for developing so great product!

Here is the output of # convert -v:
Version: ImageMagick 6.5.3-10 2009-08-12 Q16 http://www.imagemagick.org

I try to convert a tiff image into a jpeg. During the process I get the following errors/warnings:

Code: Select all

convert: sky.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: sky.tif: unknown field with tag 40961 (0xa001) encountered. `TIFFReadCustomDirectory' @ tiff.c/TIFFWarning
s/528.
convert: sky.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
I found a similar issue discussed here viewtopic.php?f=3&t=14397.
I tried this:

Code: Select all

# convert -define tiff:ignore-exif=true sky.tif test.jpg
but I still get the same errors.

In the end, the resulting jpeg image is rendered neither by Internet Explorer nor by Chrome. If I try to view the jpeg image with Picasa or default Windows Image Viewer, it show it correctly as if nothing is wrong.

Upgrading to ImageMagick 6.5.4-10 seems to be impossible due to system crashes when trying to get it all to work.

Here is the link to the tif file I am trying to convert:
http://rosbd.com/sky.tif

Anybody encountered such an issue? Managed to solve it?

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T05:54:43-07:00
by magick
You can safely ignore the TIFF warnings. You TIFF image is in the CMYK colorspace. Some browsers do not support CMYK. Instead convert your image to RGB with -colorspace RGB. Its better to use profiles instead (e.g. -profile).

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T20:15:06-07:00
by kolRn
Thanks for your reply!
I tried to convert with RGB colorspace, and for some images it worked fine. But not for all. I do processing using system cron which runs a php script that converts 4 images at a time. It successfully converts two of them, and then it crashes creating a php.core file around the script. It says "Segmentation Fault". Some tif images are impossible to convert or what? What else can I do to make it work?

P.S. Didn't quite get it about -profile. What is this option for?

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T20:20:50-07:00
by fmw42
did you put the -colorspace before the input?

convert -colorspace rgb input output

see input settings at http://www.imagemagick.org/Usage/basics/#why


for profiles see http://www.imagemagick.org/Usage/formats/#profiles

I am no expert on these topics, but this is what you can find by searching the archives about such problems.

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T21:23:15-07:00
by kolRn
Yes, I used colorspace option before input file like this:

Code: Select all

# convert -colorspace RGB sky.tif out.jpg
For some images it worked fine, but with others I get segmentation fault and core crash.
But I need to solve this problem very much.

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T21:39:09-07:00
by fmw42
You will need help from IM folks. but have you tried upgrading to the current version 6.5.6-1

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T21:40:36-07:00
by fmw42
your file sky.tif is very big (66MB). might you be running out of memory?

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-16T22:10:20-07:00
by kolRn
fmw42 wrote:your file sky.tif is very big (66MB). might you be running out of memory?
Another file that fails to be converted is 1.59Mb, so I am sure the problem is not in the file size.

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-17T05:52:13-07:00
by magick
Can you upgrade to the latest ImageMagick release, 6.5.6-1? If it crashes we would like to hear about it. If you know how to debug, a stack trace would be most helpful.

Re: ImageMagick convert .tif to .jpg issue

Posted: 2009-09-29T01:13:09-07:00
by bingmou
I also met this problem when I tried to convert some pictures with tif format. My convert version is :

Code: Select all

Version: ImageMagick 6.5.5-3 2009-08-27 Q16 OpenMP http://www.imagemagick.org
it was not the latest one. I couldn't convert my pictures to eps format and the error message were the same:

Code: Select all

convert: 0929101.tif: unknown field with tag 37706 (0x934a) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/546.
And files couldn't be opened.It failed...

However, I found something interesting. When I tried to convert to png format, it gave the same error while the output seemed all right. Something weird!
With GIMP, it is all right.