Skip to content

Commit

Permalink
Merge pull request #40 from kwhopper/tiff_xmp_applicationnotes
Browse files Browse the repository at this point in the history
Handle IFD0 ApplicationNotes tag (0x02BC)  as XMP
  • Loading branch information
drewnoakes committed Mar 21, 2016
2 parents 430fa31 + d539d38 commit bb9935e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions MetadataExtractor/Formats/Exif/ExifDirectoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ public abstract class ExifDirectoryBase : Directory

public const int TagReferenceBlackWhite = 0x0214;

public const int TagStripRowCounts = 0x022F;

public const int TagApplicationNotes = 0x02BC;

public const int TagRelatedImageFileFormat = 0x1000;

public const int TagRelatedImageWidth = 0x1001;
Expand Down Expand Up @@ -753,6 +757,8 @@ protected static void AddExifTagNames(Dictionary<int, string> map)
map[TagYCbCrSubsampling] = "YCbCr Sub-Sampling";
map[TagYCbCrPositioning] = "YCbCr Positioning";
map[TagReferenceBlackWhite] = "Reference Black/White";
map[TagStripRowCounts] = "Strip Row Counts";
map[TagApplicationNotes] = "Application Notes";
map[TagRelatedImageFileFormat] = "Related Image File Format";
map[TagRelatedImageWidth] = "Related Image Width";
map[TagRelatedImageHeight] = "Related Image Height";
Expand Down
9 changes: 9 additions & 0 deletions MetadataExtractor/Formats/Exif/ExifTiffHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
using MetadataExtractor.Formats.Exif.Makernotes;
using MetadataExtractor.Formats.Iptc;
using MetadataExtractor.Formats.Tiff;
using MetadataExtractor.Formats.Xmp;
using MetadataExtractor.IO;

namespace MetadataExtractor.Formats.Exif
Expand Down Expand Up @@ -123,6 +124,14 @@ public override bool CustomProcessTag(int tagOffset, ICollection<int> processedI
}
return false;
}

// Custom processing for embedded XMP data
if (tagId == ExifDirectoryBase.TagApplicationNotes && CurrentDirectory is ExifIfd0Directory)
{
Directories.Add(new XmpReader().Extract(reader.GetNullTerminatedString(tagOffset, byteCount)));
return true;
}

return false;
}

Expand Down

0 comments on commit bb9935e

Please sign in to comment.