Trying to open a 16 bit TIFF LAB colorspace with Magick++

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
cjmi
Posts: 11
Joined: 2012-06-28T20:31:04-07:00
Authentication code: 13

Trying to open a 16 bit TIFF LAB colorspace with Magick++

Post by cjmi »

Trying to open a Photoshop CS6 saved TIFF file with Magick++ generates "wrong data type 7 for RichTIFFIPTC; tag ignored. TIFFReadDirectory".

I tried using xnView to remove IPTC data, and I can successfully open that file with Magick++, however xnView converts 16 bit TIFFs to 8 bit, and also converts LAB colorspace TIFFs to RGB.

I need to run Magick++ on a 16 bit TIFF in LAB colorspace. The file is written this way from Photoshop, and I need accurate measurement -- and no calculations involved with the color.

So, I got a program called PhotoMe. I got a program called Exif Tag Remover. I told it to only remove IPTC data. I can still open the resulting file in Photoshop, and it's still a 16 bit TIFF in LAB. :)

But, now, Magick++ errors with: "unknown field with tag 37724 (0x935c) encountered. TIFFReadDirectory" and "Sorry, can not handle image." (I know the tag 37724 is a warning not an error -- it's the can not handle image part I'm writing about.)



How do I proceed? I know the original wrong data type 7 error is from libtiff. I'm on 3.8.2. Anyone know if that's been fixed? If I know it has, I could consider trying to upgrade, but I'm on CentOS, so that could be a giant mess with dependencies.

Otherwise, is there a known way to strip off the IPTC data without forcing a bit depth change and colorspace change through xnView?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Trying to open a 16 bit TIFF LAB colorspace with Magick+

Post by fmw42 »

What version of IM are you using. The IM conversion between sRGB and LAB was only fixed finally in the current release or IM 6.7.7.9. But you have to work in HDRI mode in LAB to process it in any way in LAB. I am not sure if you need HDRI mode to just open it and look at it, but to process it further you need to be in HDRI.

see
viewtopic.php?f=1&t=21099

Generally warnings about TIFF tags are just warnings and can be ignored. So I am not sure you really need to strip any meta data. Just upgrade your IM version.

Also I have only tested in command line mode. So I suggest that you try that first before using and API.
cjmi
Posts: 11
Joined: 2012-06-28T20:31:04-07:00
Authentication code: 13

Re: Trying to open a 16 bit TIFF LAB colorspace with Magick+

Post by cjmi »

Oops, thought I included that, but just included the libtiff version (3.8.2.)

ImageMagick, -c++, -c++-devel, -devel are all on 6.2.8, so I'm a ways back, and looks like I'll have to upgrade.

By "The IM conversion between sRGB and LAB was only fixed"... Do you mean there was an issue displaying colors from an image already in LAB colorspace through the .red(), .green(), .blue() functions... Or that there was an issue actually converting a RGB colorspace image to LAB through .colorSpace(LABColorspace)?



The "wrong data type 7" error seems to be an exception thrown from libtiff, so it doesn't seem to be one of those that can be ignored. Program execution stops.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Trying to open a 16 bit TIFF LAB colorspace with Magick+

Post by fmw42 »

I don't know about whether the fix included the opening or viewing of a LAB image. I only know that conversion from sRGB to LAB and modification in LAB and then converting back to sRGB was not working properly.

But as your version of IM is about 500 versions old, I would expect that you might have trouble with such an old version. Though I cannot say for sure.

If you want to post a link to your LAB image and post a picture of what it should look like from Photoshop (screen snap), then I could try to open the file in the current IM in command line mode and see what I get either in Q16 or Q16 HDRI on my Mac OSX Snow Leopard.

I might not get to it until tomorrow, though. It is getting late here and I have to get up very early tomorrow.
Post Reply