Added basic config to support SonyMinolta and SonyCs groups. (Patches from Gilles Caulier)

This commit is contained in:
Andreas Huggel 2010-04-20 15:56:04 +00:00
parent 611b4182e5
commit bf17786a04
7 changed files with 86 additions and 27 deletions

View File

@ -109,6 +109,8 @@ namespace Exiv2 {
const uint16_t nikonsi5 = 317; //!< Nikon Shot Info v2.* Tags
const uint16_t nikonsi6 = 318; //!< Nikon Shot Info v1.* Tags
const uint16_t canonfi = 320; //!< Canon File Info
const uint16_t sonymltmn = 330; //!< Sony Minolta Makernotes
const uint16_t sonycs = 331; //!< Sony Camera Settings
}
// *****************************************************************************

View File

@ -207,6 +207,35 @@ namespace Exiv2 {
{ 14, N_("Incandescent") }
};
std::ostream& SonyMakerNote::print0xb000(std::ostream& os, const Value& value, const ExifData*)
{
if (value.count() != 4)
{
os << "(" << value << ")";
}
else
{
std::string val = value.toString(0) + value.toString(1) + value.toString(2) + value.toString(3);
if (val == "0002") os << "JPEG";
else if (val == "1000") os << "SR2";
else if (val == "2000") os << "ARW 1.0";
else if (val == "3000") os << "ARW 2.0";
else if (val == "3100") os << "ARW 2.1";
else os << "(" << value << ")";
}
return os;
}
std::ostream& SonyMakerNote::printImageSize(std::ostream& os, const Value& value, const ExifData*)
{
if (value.count() == 2)
os << value.toString(0) << " x " << value.toString(1);
else
os << "(" << value << ")";
return os;
}
// Sony MakerNote Tag Info
const TagInfo SonyMakerNote::tagInfo_[] = {
@ -351,33 +380,24 @@ namespace Exiv2 {
return tagInfo_;
}
std::ostream& SonyMakerNote::print0xb000(std::ostream& os, const Value& value, const ExifData*)
{
if (value.count() != 4)
{
os << "(" << value << ")";
}
else
{
std::string val = value.toString(0) + value.toString(1) + value.toString(2) + value.toString(3);
if (val == "0002") os << "JPEG";
else if (val == "1000") os << "SR2";
else if (val == "2000") os << "ARW 1.0";
else if (val == "3000") os << "ARW 2.0";
else if (val == "3100") os << "ARW 2.1";
else os << "(" << value << ")";
}
return os;
}
// -- Sony camera settings ---------------------------------------------------------------
std::ostream& SonyMakerNote::printImageSize(std::ostream& os, const Value& value, const ExifData*)
{
if (value.count() == 2)
os << value.toString(0) << " x " << value.toString(1);
else
os << "(" << value << ")";
// Sony Camera Settings Tag Info
const TagInfo SonyMakerNote::tagInfoCs_[] = {
return os;
TagInfo(0x0016, "ISOSetting", N_("ISO Setting"),
N_("ISO Setting"),
sonyCsIfdId, makerTags, unsignedShort, printValue),
// End of list marker
TagInfo(0xffff, "(UnknownSonyCsTag)", "(UnknownSonyCsTag)",
N_("Unknown Sony Camera Settings tag"),
sonyCsIfdId, makerTags, invalidTypeId, printValue)
};
const TagInfo* SonyMakerNote::tagListCs()
{
return tagInfoCs_;
}
} // namespace Exiv2

View File

@ -55,6 +55,8 @@ namespace Exiv2 {
public:
//! Return read-only list of built-in Sony tags
static const TagInfo* tagList();
//! Return read-only list of built-in Sony Standard Camera Settings tags
static const TagInfo* tagListCs();
//! @name Print functions for Sony %MakerNote tags
//@{
@ -66,6 +68,7 @@ namespace Exiv2 {
private:
//! Tag information
static const TagInfo tagInfo_[];
static const TagInfo tagInfoCs_[];
}; // class SonyMakerNote
} // namespace Exiv2

View File

@ -171,6 +171,8 @@ namespace Exiv2 {
{ pentaxIfdId, "Makernote", "Pentax", PentaxMakerNote::tagList },
{ sigmaIfdId, "Makernote", "Sigma", SigmaMakerNote::tagList },
{ sonyIfdId, "Makernote", "Sony", SonyMakerNote::tagList },
{ sonyMltIfdId, "Makernote", "SonyMinolta", MinoltaMakerNote::tagList },
{ sonyCsIfdId, "Makernote", "SonyCs", SonyMakerNote::tagListCs },
{ lastIfdId, "(Last IFD info)", "(Last IFD item)", 0 }
};

View File

@ -156,7 +156,9 @@ namespace Exiv2 {
{ 316, "NikonSiD300b" },
{ 317, "NikonSi02xx" },
{ 318, "NikonSi01xx" },
{ 320, "CanonFi" }
{ 320, "CanonFi" },
{ 330, "SonyMinolta" },
{ 331, "SonyCs" }
};
bool TiffGroupInfo::operator==(const uint16_t& group) const

View File

@ -794,6 +794,23 @@ namespace Exiv2 {
{ 146, ttSignedShort, 1 } // Exif.MinoltaCs5D.ColorTemperature
};
//! Sony Camera Settings binary array - configuration
extern const ArrayCfg sonyCsCfg = {
Group::sonycs, // Group for the elements
bigEndian, // Big endian
ttUndefined, // Type for array entry and size element
notEncrypted, // Not encrypted
false, // No size element
false, // No fillers
false, // Don't concatenate gaps
{ 0, ttUnsignedShort, 1 }
};
//! Sony Camera Settings binary array - definition
extern const ArrayDef sonyCsDef[] = {
{ 6, ttUnsignedShort, 1 }, // Exif.SonyCs.DriveMode
{ 10, ttSignedShort, 1 } // Exif.SonyCs.WhiteBalanceFineTune
};
/*
This table lists for each group in a tree, its parent group and tag.
Root identifies the root of a TIFF tree, as there is a need for multiple
@ -877,6 +894,8 @@ namespace Exiv2 {
{ Tag::root, Group::pentaxmn, Group::exif, 0x927c },
{ Tag::root, Group::sigmamn, Group::exif, 0x927c },
{ Tag::root, Group::sony1mn, Group::exif, 0x927c },
{ Tag::root, Group::sonycs, Group::sony1mn, 0x0114 },
{ Tag::root, Group::sonymltmn, Group::sony1mn, 0xb028 },
{ Tag::root, Group::sony2mn, Group::exif, 0x927c },
{ Tag::root, Group::minoltamn, Group::exif, 0x927c },
{ Tag::root, Group::minocso, Group::minoltamn, 0x0001 },
@ -1235,12 +1254,21 @@ namespace Exiv2 {
// Sony1 makernote
{ Tag::next, Group::sony1mn, newTiffDirectory<Group::ignr> },
{ 0x0114, Group::sony1mn, EXV_BINARY_ARRAY(sonyCsCfg, sonyCsDef) },
{ 0xb028, Group::sony1mn, newTiffSubIfd<Group::sonymltmn> },
{ Tag::all, Group::sony1mn, newTiffEntry },
// Sony1 camera settings
{ Tag::all, Group::sonycs, newTiffBinaryElement },
// Sony2 makernote
{ Tag::next, Group::sony2mn, newTiffDirectory<Group::ignr> },
{ Tag::all, Group::sony2mn, newTiffEntry },
// Sony Minolta makernote
{ Tag::next, Group::sonymltmn, newTiffDirectory<Group::ignr> },
{ Tag::all, Group::sonymltmn, newTiffEntry },
// Minolta makernote
{ 0x0001, Group::minoltamn, EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg) },
{ 0x0003, Group::minoltamn, EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg) },
@ -1662,7 +1690,7 @@ namespace Exiv2 {
{ 0x010a, Group::ifd0 }, // Exif.Image.FillOrder
{ 0x0111, Group::ifd0 }, // Exif.Image.StripOffsets
{ 0x0115, Group::ifd0 }, // Exif.Image.SamplesPerPixel
{ 0x0116, Group::ifd0 }, // Exif.Image.RowsPerStrip
{ 0x0116, Group::ifd0 }, // Exif.Image.RowsPerStrip
{ 0x0117, Group::ifd0 }, // Exif.Image.StripByteCounts
{ 0x011a, Group::ifd0 }, // Exif.Image.XResolution
{ 0x011b, Group::ifd0 }, // Exif.Image.YResolution

View File

@ -224,6 +224,8 @@ namespace Exiv2 {
pentaxIfdId,
sigmaIfdId,
sonyIfdId,
sonyMltIfdId,
sonyCsIfdId,
lastIfdId
};