Added SamsungPictureWizard group with a decoding table for the Mode tag from Pascal de Bruijn.

This commit is contained in:
Andreas Huggel 2011-12-26 17:12:55 +00:00
parent 3eb005623e
commit d542872228
7 changed files with 81 additions and 14 deletions

View File

@ -100,6 +100,7 @@ TABLES = Exif \
PanasonicRaw \ PanasonicRaw \
Pentax \ Pentax \
Samsung2 \ Samsung2 \
SamsungPictureWizard \
Sigma \ Sigma \
Sony1 \ Sony1 \
SonyMinolta \ SonyMinolta \

View File

@ -8,10 +8,17 @@ __index1__
__index2__ __index2__
<h2>Samsung MakerNote Tags defined in Exiv2</h2> <h2>Samsung MakerNote Tags defined in Exiv2</h2>
<div> <div>
<p>Tags found in the MakerNote of images taken with Samsung cameras.</a>.</p> <p>Tags found in the MakerNote of images taken with Samsung cameras.</p>
<p>Click on a column header to sort the table.</p> <p>Click on a column header to sort the table.</p>
</div> </div>
__Samsung2__ __Samsung2__
<br>
<h3>Samsung Picture Wizard Tags</h3>
<p>Click on a column header to sort the table.</p>
__SamsungPictureWizard__
<br>
</div> </div>
<!-- closes content --> <!-- closes content -->

View File

@ -72,18 +72,6 @@ namespace Exiv2 {
{ 1, N_("On") } { 1, N_("On") }
}; };
std::ostream& printPictureWizard(std::ostream& os, const Value& value, const ExifData*)
{
if (value.count() != 5 || value.typeId() != unsignedShort) {
return os << value;
}
return os << "Mode: " << value.toLong(0)
<< ", Col: " << value.toLong(1)
<< ", Sat: " << value.toLong(2) - 4
<< ", Sha: " << value.toLong(3) - 4
<< ", Con: " << value.toLong(4) - 4;
}
std::ostream& printCameraTemperature(std::ostream& os, const Value& value, const ExifData*) std::ostream& printCameraTemperature(std::ostream& os, const Value& value, const ExifData*)
{ {
if (value.count() != 1 || value.typeId() != signedRational) { if (value.count() != 1 || value.typeId() != signedRational) {
@ -113,7 +101,7 @@ namespace Exiv2 {
// Samsung MakerNote Tag Info // Samsung MakerNote Tag Info
const TagInfo Samsung2MakerNote::tagInfo_[] = { const TagInfo Samsung2MakerNote::tagInfo_[] = {
TagInfo(0x0001, "Version", N_("Version"), N_("Makernote version"), samsung2Id, makerTags, undefined, -1, printExifVersion), TagInfo(0x0001, "Version", N_("Version"), N_("Makernote version"), samsung2Id, makerTags, undefined, -1, printExifVersion),
TagInfo(0x0021, "PictureWizard", N_("Picture Wizard"), N_("Picture wizard"), samsung2Id, makerTags, unsignedShort, -1, printPictureWizard), TagInfo(0x0021, "PictureWizard", N_("Picture Wizard"), N_("Picture wizard composite tag"), samsung2Id, makerTags, unsignedShort, -1, printValue),
TagInfo(0x0030, "LocalLocationName", N_("Local Location Name"), N_("Local location name"), samsung2Id, makerTags, asciiString, -1, printValue), TagInfo(0x0030, "LocalLocationName", N_("Local Location Name"), N_("Local location name"), samsung2Id, makerTags, asciiString, -1, printValue),
TagInfo(0x0031, "LocationName", N_("Location Name"), N_("Location name"), samsung2Id, makerTags, asciiString, -1, printValue), TagInfo(0x0031, "LocationName", N_("Location Name"), N_("Location name"), samsung2Id, makerTags, asciiString, -1, printValue),
TagInfo(0x0035, "Preview", N_("Pointer to a preview image"), N_("Offset to an IFD containing a preview image"), samsung2Id, makerTags, unsignedLong, -1, printValue), TagInfo(0x0035, "Preview", N_("Pointer to a preview image"), N_("Offset to an IFD containing a preview image"), samsung2Id, makerTags, unsignedLong, -1, printValue),
@ -151,4 +139,44 @@ namespace Exiv2 {
return tagInfo_; return tagInfo_;
} }
//! PictureWizard Mode
extern const TagDetails samsungPwMode[] = {
{ 0, N_("Standard") },
{ 1, N_("Vivid") },
{ 2, N_("Portrait") },
{ 3, N_("Landscape") },
{ 4, N_("Forest") },
{ 5, N_("Retro") },
{ 6, N_("Cool") },
{ 7, N_("Calm") },
{ 8, N_("Classic") },
{ 9, N_("Custom1") },
{ 10, N_("Custom2") },
{ 11, N_("Custom3") }
};
std::ostream& printValueMinus4(std::ostream& os, const Value& value, const ExifData*)
{
if (value.count() != 1 || value.typeId() != unsignedShort) {
return os << value;
}
return os << value.toLong(0) - 4;
}
// Samsung PictureWizard Tag Info
const TagInfo Samsung2MakerNote::tagInfoPw_[] = {
TagInfo(0x0000, "Mode", N_("Mode"), N_("Mode"), samsungPwId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(samsungPwMode)),
TagInfo(0x0001, "Color", N_("Color"), N_("Color"), samsungPwId, makerTags, unsignedShort, 1, printValue),
TagInfo(0x0002, "Saturation", N_("Saturation"), N_("Saturation"), samsungPwId, makerTags, unsignedShort, 1, printValueMinus4),
TagInfo(0x0003, "Sharpness", N_("Sharpness"), N_("Sharpness"), samsungPwId, makerTags, unsignedShort, 1, printValueMinus4),
TagInfo(0x0004, "Contrast", N_("Contrast"), N_("Contrast"), samsungPwId, makerTags, unsignedShort, 1, printValueMinus4),
// End of list marker
TagInfo(0xffff, "(UnknownSamsungPictureWizardTag)", "(UnknownSamsungPictureWizardTag)", N_("Unknown SamsungPictureWizard tag"), samsungPwId, makerTags, unsignedShort, 1, printValue)
};
const TagInfo* Samsung2MakerNote::tagListPw()
{
return tagInfoPw_;
}
}} // namespace Internal, Exiv2 }} // namespace Internal, Exiv2

View File

@ -53,10 +53,14 @@ namespace Exiv2 {
public: public:
//! Return read-only list of built-in Samsung tags //! Return read-only list of built-in Samsung tags
static const TagInfo* tagList(); static const TagInfo* tagList();
//! Return read-only list of built-in PictureWizard tags
static const TagInfo* tagListPw();
private: private:
//! Tag information //! Tag information
static const TagInfo tagInfo_[]; static const TagInfo tagInfo_[];
//! PictureWizard tag information
static const TagInfo tagInfoPw_[];
}; // class Samsung2MakerNote }; // class Samsung2MakerNote

View File

@ -163,6 +163,7 @@ namespace Exiv2 {
{ pentaxId, "Makernote", "Pentax", PentaxMakerNote::tagList }, { pentaxId, "Makernote", "Pentax", PentaxMakerNote::tagList },
{ samsung2Id, "Makernote", "Samsung2", Samsung2MakerNote::tagList }, { samsung2Id, "Makernote", "Samsung2", Samsung2MakerNote::tagList },
{ samsungPvId, "Makernote", "SamsungPreview", ifdTagList }, { samsungPvId, "Makernote", "SamsungPreview", ifdTagList },
{ samsungPwId, "Makernote", "SamsungPictureWizard", Samsung2MakerNote::tagListPw },
{ sigmaId, "Makernote", "Sigma", SigmaMakerNote::tagList }, { sigmaId, "Makernote", "Sigma", SigmaMakerNote::tagList },
{ sony1Id, "Makernote", "Sony1", SonyMakerNote::tagList }, { sony1Id, "Makernote", "Sony1", SonyMakerNote::tagList },
{ sony2Id, "Makernote", "Sony2", SonyMakerNote::tagList }, { sony2Id, "Makernote", "Sony2", SonyMakerNote::tagList },

View File

@ -141,6 +141,7 @@ namespace Exiv2 {
pentaxId, pentaxId,
samsung2Id, samsung2Id,
samsungPvId, samsungPvId,
samsungPwId,
sigmaId, sigmaId,
sony1Id, sony1Id,
sony2Id, sony2Id,

View File

@ -1117,6 +1117,26 @@ namespace Exiv2 {
{ 190, ttSignedShort, 1 } // Exif.Sony1MltCsA100.ColorCompensationFilter2 { 190, ttSignedShort, 1 } // Exif.Sony1MltCsA100.ColorCompensationFilter2
}; };
//! Samsung PictureWizard binary array - configuration
extern const ArrayCfg samsungPwCfg = {
samsungPwId, // Group for the elements
invalidByteOrder, // Use byte order from parent
ttUnsignedShort, // Type for array entry
notEncrypted, // Not encrypted
false, // No size element
true, // Write all tags
true, // Concatenate gaps
{ 0, ttUnsignedShort, 1 }
};
//! Samsung PictureWizard binary array - definition
extern const ArrayDef samsungPwDef[] = {
{ 0, ttUnsignedShort, 1 }, // Mode
{ 2, ttUnsignedShort, 1 }, // Color
{ 4, ttUnsignedShort, 1 }, // Saturation
{ 6, ttUnsignedShort, 1 }, // Sharpness
{ 8, ttUnsignedShort, 1 } // Contrast
};
/* /*
This table lists for each group in a tree, its parent group and tag. 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 Root identifies the root of a TIFF tree, as there is a need for multiple
@ -1208,6 +1228,7 @@ namespace Exiv2 {
{ Tag::root, panasonicId, exifId, 0x927c }, { Tag::root, panasonicId, exifId, 0x927c },
{ Tag::root, pentaxId, exifId, 0x927c }, { Tag::root, pentaxId, exifId, 0x927c },
{ Tag::root, samsung2Id, exifId, 0x927c }, { Tag::root, samsung2Id, exifId, 0x927c },
{ Tag::root, samsungPwId, samsung2Id, 0x0021 },
{ Tag::root, samsungPvId, samsung2Id, 0x0035 }, { Tag::root, samsungPvId, samsung2Id, 0x0035 },
{ Tag::root, sigmaId, exifId, 0x927c }, { Tag::root, sigmaId, exifId, 0x927c },
{ Tag::root, sony1Id, exifId, 0x927c }, { Tag::root, sony1Id, exifId, 0x927c },
@ -1608,10 +1629,14 @@ namespace Exiv2 {
{ Tag::all, pentaxId, newTiffEntry }, { Tag::all, pentaxId, newTiffEntry },
// Samsung2 makernote // Samsung2 makernote
{ 0x0021, samsung2Id, EXV_BINARY_ARRAY(samsungPwCfg, samsungPwDef) },
{ 0x0035, samsung2Id, newTiffSubIfd<samsungPvId> }, { 0x0035, samsung2Id, newTiffSubIfd<samsungPvId> },
{ Tag::next, samsung2Id, newTiffDirectory<ignoreId> }, { Tag::next, samsung2Id, newTiffDirectory<ignoreId> },
{ Tag::all, samsung2Id, newTiffEntry }, { Tag::all, samsung2Id, newTiffEntry },
// Samsung PictureWizard binary array
{ Tag::all, samsungPwId, newTiffBinaryElement },
// Samsung2 makernote preview subdir // Samsung2 makernote preview subdir
{ 0x0201, samsungPvId, newTiffThumbData<0x0202, samsungPvId> }, { 0x0201, samsungPvId, newTiffThumbData<0x0202, samsungPvId> },
{ 0x0202, samsungPvId, newTiffThumbSize<0x0201, samsungPvId> }, { 0x0202, samsungPvId, newTiffThumbSize<0x0201, samsungPvId> },