ImageMagick convert .tif to .jpg issue

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
kolRn

ImageMagick convert .tif to .jpg issue

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick convert .tif to .jpg issue

Post 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).
kolRn

Re: ImageMagick convert .tif to .jpg issue

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick convert .tif to .jpg issue

Post 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.
kolRn

Re: ImageMagick convert .tif to .jpg issue

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick convert .tif to .jpg issue

Post by fmw42 »

You will need help from IM folks. but have you tried upgrading to the current version 6.5.6-1
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick convert .tif to .jpg issue

Post by fmw42 »

your file sky.tif is very big (66MB). might you be running out of memory?
kolRn

Re: ImageMagick convert .tif to .jpg issue

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick convert .tif to .jpg issue

Post 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.
bingmou

Re: ImageMagick convert .tif to .jpg issue

Post 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.
Post Reply