Image constructor crashes when open 16 bits TIF files...

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

Image constructor crashes when open 16 bits TIF files...

Post by spok » 2012-01-29T08:03:10-07:00

This is just a code to show the problem (normalyt it's 3 different files...)

Code: Select all

	Image p1("C:\\image.tif");
	::AfxMessageBox("p1 ok");

	Image p2("C:\\image.tif");
	::AfxMessageBox("p2 ok");

	Image p3("C:\\image.tif");
	::AfxMessageBox("p3 ok");
"p1 ok" is displayed always
"p2 ok" is sometimes displayed sometimes not (the program crashes when trying to construct p2)
"p3 ok" is never displayed

I have also tried to use the constructor without parameters and use read to catch an exception but no exception is thrown. The program just crashes.

Any idea ?

You can download the tif file here

spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

Re: Image constructor crashes when open 16 bits TIF files...

Post by spok » 2012-01-30T04:08:18-07:00

No idea ?
Can someone please try with the tif file and tell me if it crashes too ?
Thanks.

User avatar
magick
Site Admin
Posts: 10998
Joined: 2003-05-31T11:32:55-07:00

Re: Image constructor crashes when open 16 bits TIF files...

Post by magick » 2012-01-30T05:27:00-07:00

We converted your TIFF image 20+ times without any problems. We're using ImageMagick 6.7.5-0 which does include a TIFF-related patch for EXIF profiles. See if 6.7.5-0 resolves your crashes.

spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

Re: Image constructor crashes when open 16 bits TIF files...

Post by spok » 2012-01-30T08:13:50-07:00

magick wrote:We converted your TIFF image 20+ times without any problems. We're using ImageMagick 6.7.5-0 which does include a TIFF-related patch for EXIF profiles. See if 6.7.5-0 resolves your crashes.
OK. Thanks. I will try and let you know if it was indeed a version problem.
I'm using 6.7.3.8.

spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

Re: Image constructor crashes when open 16 bits TIF files...

Post by spok » 2012-01-30T13:56:57-07:00

You were right. It works with version 6.7.5.0. Thanks.

However, I have noticed an important change in comparison with version 6.7.3.8.

I'm using 16 bits depth quantum and PixelPacket to have acces to pixel colors.
When working with jpeg or 8 bits tif, the color is stored in the low order byte of the 16 bits word.
However when working with 16 bits tif, the low order byte of the color is stored in the high order byte and vice-versa !
I had to modify my program to permute the bytes when working with 16 bits tif files.
There was no problem of that kind in 6.7.3.8.

User avatar
magick
Site Admin
Posts: 10998
Joined: 2003-05-31T11:32:55-07:00

Re: Image constructor crashes when open 16 bits TIF files...

Post by magick » 2012-01-30T14:46:41-07:00

If you're dealing with raw 16-bit pixels, you can set the endian to either MSB to LSB or visa versa.

spok
Posts: 36
Joined: 2011-10-31T07:32:23-07:00
Authentication code: 8675308

Re: Image constructor crashes when open 16 bits TIF files...

Post by spok » 2012-01-30T15:48:15-07:00

magick wrote:If you're dealing with raw 16-bit pixels, you can send the endian to set either MSB to LSB or visa versa.
Thanks a lot !

Post Reply