New TIFF parser: Added simple IFD based Sony Makernote

This commit is contained in:
Andreas Huggel 2006-04-29 11:37:53 +00:00
parent 15b0cf42ad
commit 448177d097
3 changed files with 15 additions and 7 deletions

View File

@ -405,11 +405,16 @@ namespace Exiv2 {
TiffComponent* newSonyMn(uint16_t tag,
uint16_t group,
uint16_t mnGroup,
const byte* /*pData*/,
uint32_t /*size*/,
const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
{
return new TiffIfdMakernote(tag, group, mnGroup, new SonyMnHeader);
// If there is no "SONY DSC " string we assume it's a simple IFD Makernote
if (size < 12 || std::string(reinterpret_cast<const char*>(pData), 12)
!= std::string("SONY DSC \0\0\0", 12)) {
return new TiffIfdMakernote(tag, group, Group::sony2mn, 0, true);
}
return new TiffIfdMakernote(tag, group, Group::sony1mn, new SonyMnHeader, false);
}
} // namespace Exiv2

View File

@ -55,8 +55,9 @@ namespace Exiv2 {
const uint16_t nikon3mn = 266; //!< Nikon3 makernote
const uint16_t panamn = 267; //!< Panasonic makernote
const uint16_t sigmamn = 268; //!< Sigma makernote
const uint16_t sonymn = 269; //!< Sony makernote
const uint16_t sonymn = 269; //!< Any Sony makernote (pseudo group)
const uint16_t sony1mn = 270; //!< Sony1 makernote
const uint16_t sony2mn = 271; //!< Sony2 makernote
}
// *****************************************************************************

View File

@ -105,13 +105,15 @@ namespace Exiv2 {
case 260: group = "CanonCs1"; break;
case 261: group = "CanonCs2"; break;
case 262: group = "CanonCf"; break;
// 263 not needed (canonmn)
// 263 not needed (nikonmn)
case 264: group = "Nikon1"; break;
case 265: group = "Nikon2"; break;
case 266: group = "Nikon3"; break;
case 267: group = "Panasonic"; break;
case 268: group = "Sigma"; break;
case 269: group = "Sony"; break;
// 269 not needed (sonymn)
case 270: group = "Sony"; break;
case 271: group = "Sony"; break;
default: group = "Unknown"; break;
}
return group;