We have quite a few multipage tiff documents that some of the pages are displayed as inverted. It was determined that the Tiff tag: 'Photometric' is set to 1 (MinIsBlack) which is probably a mistake or bug in another software that generated the images. To correct this issue we tried to read this tag, but the SDK does not seem to return it. How do we read the 'PhotometricInterpretation' tag: 262 (hex 0x0106)??
http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html
And if we can read the tag, can we change it to have the viewer display the image the other way, or can we have the library ignore the tag all together? Does the long FxNegative() call use this tag?
Second, we noticed that if I take a tiff page that has 'Photometric' set to 1 (MinIsBlack) and write or append it to another tiff file, the 'Photometric' tag for the page becomes 0 (MinIsWhite) and the image is still displayed in the inverted state. Is this a known issue? Once this happens we can no longer use the 'Photometric' tag to detect an inverted page. I do have TagsSetPreserve(TRUE).
I also noticed that there is no TagsSetPreserve call for the viewer. Does this mean if the image is open in the viewer, we can not read the tags associated with it, using a method like this:
- Code: Select all
....
ImageCtrl.SetNativeImage( ViewerCtrl.GetNativeImage());
long lTotal = ImageCtrl.ExifTagCount();
for(long lIndex = 1; lIndex <= lTotal; lIndex++)
{
long lValue = ImageCtrl.ExifTagGetID(lIndex);
CString strName = ImageCtrl.ExifTagGetName(lIndex);
CString strValue = ImageCtrl.ExifTagGetValueString(lIndex);
// do something with the tags...
}
We are using:
GdPicture Pro Imaging SDK 5.13.2
Visual Studio 2003 on Windows 2000
MFC application.
What are my options for handling these inverted images programatically and making them correct. Any help would be greatly appreciated.
Thanks..
