2009.12.10 18:28 "[Tiff] YCbCr", by Steve Mills

2009.12.10 20:55 "Re: [Tiff] YCbCr", by Steve Mills

On Dec 10, 2009, at 14:32:14, Joris Van Damme (AWare Systems) wrote:

It does, in the sense that it is LibTiff's wrong way to try and support the result that you're after in this particular case. Do thorough testing, and if it works for you, it works for you.

So, what you were getting was not channel-order-inversed RGB, but YCbCr, actually. And that is what the Photometric said you'd get. Only if the Photometric is YCbCr, and the compression is JPEG, can you suddenly turn this into RGB by using this magical out-of-the-blue pseudo-tag. But you'll have to remember to have your code thoroughly check for these conditions, and use the magical pseudo-tag.

So you're saying I can NOT just ALWAYS set this tag? I tried setting it only after reading had begin and we were reading tags to get color space, pixel size, etc, but it did not work. Moving the tag-setting to right after TIFFClientOpen made it work. Are you saying that we will get incorrect results for other cases that are NOT YCbCr jpeg-compressed?

The same tester just sent me a cymk jpeg-compressed tiff (PC byte order, created in Photoshop CS3). It is showing up wrong. Each pixel should be cmyk 0%,99%,99%,0% (that's what I see in Photoshop - the entire file is red, not a great test file, but that's what he sent), but the hex values I see for each pixel are 4d,55,ff,00 after we call TIFFReadScanline.

I tried making my own test document in Photoshop CS4, but my files are showing up correctly. They're much smaller and contain pixels colored cyan, magenta, yellow, and black.

_________________________________________________________
Steve Mills Me: 952-401-6255
Senior Software Architect MultiAd
smills@multiad.com www.multi-ad.com