[Digikam-devel] [Bug 137750] color mode2 nikon d70s not recognized as adobe rgb
Gilles Caulier
caulier.gilles at gmail.com
Wed Jun 13 09:13:00 BST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=137750
caulier.gilles gmail com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From caulier.gilles gmail com 2007-06-13 10:12 -------
SVN commit 674817 by cgilles:
libkexiv2 from KDE3 branch : With Nikon camera, the AdobeRgb user color space is defined to set Exif.Photo.ColorSpace to Uncalibrated and Exif.Nikon3.ColorMode to MODE2.
BUG: 137750
M +23 -20 kexiv2.cpp
--- branches/extragear/kde3/libs/libkexiv2/libkexiv2/kexiv2.cpp #674816:674817
@ -841,42 +841,45 @
KExiv2::ImageColorWorkSpace KExiv2::getImageColorWorkSpace() const
{
- if (d->exifMetadata.empty())
- return WORKSPACE_UNSPECIFIED;
-
- try
- {
- // Try to get Exif.Image tags
- Exiv2::ExifData exifData(d->exifMetadata);
- Exiv2::ExifKey key("Exif.Photo.ColorSpace");
- Exiv2::ExifData::iterator it = exifData.findKey(key);
-
- if (it != exifData.end())
+ if (!d->exifMetadata.empty())
+ {
+ long colorSpace;
+
+ if (getExifTagLong("Exif.Photo.ColorSpace", colorSpace))
{
- switch (it->toLong())
+ switch (colorSpace)
{
case 1:
+ {
return WORKSPACE_SRGB;
break;
+ }
case 2:
+ {
return WORKSPACE_ADOBERGB;
break;
+ }
case 65535:
+ {
+ // Nikon camera set Exif.Photo.ColorSpace to uncalibrated and
+ // Exif.Nikon3.ColorMode to "MODE2" when users work in AdobRGB color space.
+ if (getExifTagString("Exif.Nikon3.ColorMode").contains("MODE2"))
+ return WORKSPACE_ADOBERGB;
+
+ // TODO : add more Makernote parsing here ...
+
return WORKSPACE_UNCALIBRATED;
break;
+ }
default:
+ {
return WORKSPACE_UNSPECIFIED;
break;
+ }
}
}
-
- // TODO : add here Makernote parsing if necessary.
- }
- catch( Exiv2::Error &e )
- {
- printExiv2ExceptionError("Cannot parse image color workspace tag using Exiv2 ", e);
- }
-
+ }
+
return WORKSPACE_UNSPECIFIED;
}
More information about the Digikam-devel
mailing list