Skip to content

Commit

Permalink
Adobe DNG: recognize EXIF tags (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
twest820 committed Sep 20, 2018
1 parent 0dbbf68 commit fa2d579
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MetadataExtractor.Tests/DirectoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void GetNonExistentTagIsNullForAllTypes()
}

[Fact]
public void ToStringMethod()
public void ToSimpleStringWithDefaultCulture()
{
var directory = new ExifIfd0Directory();
Assert.Equal("Exif IFD0 Directory (0 tags)", directory.ToString());
Expand Down
2 changes: 1 addition & 1 deletion MetadataExtractor.Tests/RationalTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void Construction()

[Fact]
[SuppressMessage("ReSharper", "SpecifyACultureInStringConversionExplicitly")]
public void ToStringMethod()
public void ToSimpleStringWithDefaultCulture()
{
Assert.Equal("1/3", new Rational(1, 3).ToString());
}
Expand Down
2 changes: 1 addition & 1 deletion MetadataExtractor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {15F8CDD5-5EFF-4277-8559-5AA83D1353C8}
SolutionGuid = {B3C98CDA-0400-456E-887B-70F751903DC3}
EndGlobalSection
EndGlobal
187 changes: 187 additions & 0 deletions MetadataExtractor/Formats/Exif/ExifDirectoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,102 @@ public abstract class ExifDirectoryBase : Directory

public const int TagLens = 0xFDEA;

// tags from the Adobe DNG specification, v1.4.0.0
// Retrieved from https://helpx.adobe.com/photoshop/digital-negative.html, 2018-01-06. Tags are in the
// order in which they appear in the specification.
public const int TagDngVersion = 0xC612;
public const int TagDngBackwardVersion = 0xC613;
public const int TagUniqueCameraModel = 0xC614;
public const int TagLocalizedCameraModel = 0xC615;
public const int TagCfaPlaneColor = 0xC616;
public const int TagCfaLayout = 0xC617;
public const int TagLinearizationTable = 0xC618;
public const int TagBlackLevelRepeatDim = 0xC619;
public const int TagBlackLevel = 0xC61A;
public const int TagBlackLevelDeltaH = 0xC61B;
public const int TagBlackLevelDeltaV = 0xC61C;
public const int TagWhiteLevel = 0xC61D;
public const int TagDefaultScale = 0xC61E;
public const int TagBestQualityScale = 0xC65C;
public const int TagDefaultCropOrigin = 0xC61F;
public const int TagDefaultCropSize = 0xC620;
public const int TagCalibrationIlluminant1 = 0xC65A;
public const int TagCalibrationIlluminant2 = 0xC65B;
public const int TagColorMatrix1 = 0xC621;
public const int TagColorMatrix2 = 0xC622;
public const int TagCameraCalibration1 = 0xC623;
public const int TagCameraCalibration2 = 0xC624;
public const int TagReductionMatrix1 = 0xC625;
public const int TagReductionMatrix2 = 0xC626;
public const int TagAnalogBalance = 0xC627;
public const int TagAsShotNeutral = 0xC628;
public const int TagAsShotWhiteXY = 0xC628;
public const int TagBaselineExposure = 0xC62A;
public const int TagBaselineNoise = 0xC62B;
public const int TagBaselineSharpness = 0xC62C;
public const int TagBayerGreenSplit = 0xC62D;
public const int TagLinearResponseLimit = 0xC62D;
public const int TagCameraSerialNumber = 0xC62F;
public const int TagLensInfo = 0xC630;
public const int TagChromaBlurRadius = 0xC631;
public const int TagAntiAliasStrength = 0xC632;
public const int TagShadowScale = 0xC633;
public const int TagDngPrivateData = 0xC634;
public const int TagMakerNoteSafety = 0xC634;
public const int TagRawDataUniqueID = 0xC65D;
public const int TagOriginalRawFileName = 0xC68B;
public const int TagOriginalRawFileData = 0xC68C;
public const int TagActiveArea = 0xC68D;
public const int TagMaskedArea = 0xC68E;
public const int TagAsShotIccProfile = 0xC68F;
public const int TagAsShotPreProfileMatrix = 0xC690;
public const int TagCurrentIccProfile = 0xC691;
public const int TagCurrentPreProfileMatrix = 0xC692;
// tags added in DNG 1.2.0.0
public const int TagColorimetricReference = 0xC6BF;
public const int TagCameraCalibrationSignature = 0xC6F3;
public const int TagProfileCalibrationSignature = 0xC6F4;
public const int TagExtraCameraProfiles = 0xC6F5;
public const int TagAsShotProfileName = 0xC6F6;
public const int TagNoiseReductionApplied = 0xC6F7;
public const int TagProfileName = 0xC6F8;
public const int TagProfileHueSatMapDims = 0xC6F9;
public const int TagProfileHuseSatMapData1 = 0xC6FA;
public const int TagProfileHuseSatMapData2 = 0xC6FB;
public const int TagProfileToneCurve = 0xC6FC;
public const int TagProfileEmbedPolicy = 0xC6FD;
public const int TagProfileCopyright = 0xC6FE;
public const int TagForwardMatrix1 = 0xC714;
public const int TagForwardMatrix2 = 0xC715;
public const int TagPreviewApplicationName = 0xC716;
public const int TagPreviewApplicationVersion = 0xC717;
public const int TagPreviewSettingsName = 0xC718;
public const int TagPreviewSettingsDigest = 0xC719;
public const int TagPreviewColorSpace = 0xC71A;
public const int TagPreviewDateTime = 0xC71B;
public const int TagRawImageDigest = 0xC71C;
public const int TagOriginalRawFileDigest = 0xC71D;
public const int TagSubTileBlockSize = 0xC71E;
public const int TagRowInterleaveFactor = 0xC71F;
public const int TagProfileLookTableDims = 0xC725;
public const int TagProfileLookTableData = 0xC726;
// tags added in DNG 1.3.0.0
public const int TagOpcodeList1 = 0xC740;
public const int TagOpcodeList2 = 0xC741;
public const int TagOpcodeList3 = 0xC74E;
public const int TagNoiseProfile = 0xC761;
// tags added in DNG 1.4.0.0
public const int TagDefaultUserCrop = 0xC7B5;
public const int TagDefaultBlackRender = 0xC7A6;
public const int TagBaselineExposureOffset = 0xC7A5;
public const int TagProfileLookTableEncoding = 0xC7A4;
public const int TagProfileHueSatMapEncoding = 0xC7A3;
public const int TagOriginalDefaultFinalSize = 0xC791;
public const int TagOriginalBestQualityFinalSize = 0xC792;
public const int TagOriginalDefaultCropSize = 0xC793;
public const int TagNewRawImageDigest = 0xC7A7;
public const int TagRawToPreviewGain = 0xC7A8;

protected static void AddExifTagNames([NotNull] Dictionary<int, string> map)
{
map[TagInteropIndex] = "Interoperability Index";
Expand Down Expand Up @@ -884,6 +980,97 @@ protected static void AddExifTagNames([NotNull] Dictionary<int, string> map)
map[TagPanasonicTitle2] = "Panasonic Title (2)";
map[TagPadding] = "Padding";
map[TagLens] = "Lens";

// Adobe DNG tags
map[TagDngVersion] = "DNG Version";
map[TagDngBackwardVersion] = "DNG Backward Version (oldest compatible version)";
map[TagUniqueCameraModel] = "Unique Camera Model";
map[TagLocalizedCameraModel] = "Localized Camera Model";
map[TagCfaPlaneColor] = "CFA Plane Color";
map[TagCfaLayout] = "CFA Layout";
map[TagLinearizationTable] = "Linearization Table";
map[TagBlackLevelRepeatDim] = "Black Level Repeat";
map[TagBlackLevel] = "Black Level";
map[TagBlackLevelDeltaH] = "Black Level DeltaH";
map[TagBlackLevelDeltaV] = "Black Level DeltaV";
map[TagWhiteLevel] = "White Level";
map[TagDefaultScale] = "Default Scale";
map[TagBestQualityScale] = "Best Quality Scale";
map[TagDefaultCropOrigin] = "Default Crop Origin";
map[TagDefaultCropSize] = "Default Crop Size";
map[TagCalibrationIlluminant1] = "Calibration Illuminant 1";
map[TagCalibrationIlluminant2] = "Calibration Illuminant 2";
map[TagColorMatrix1] = "Color Matrix 1";
map[TagColorMatrix2] = "Color Matrix 2";
map[TagCameraCalibration1] = "Camera Calibration 1";
map[TagCameraCalibration2] = "Camera Calibration 2";
map[TagReductionMatrix1] = "Reduction Matrix 1";
map[TagReductionMatrix2] = "Reduction Matrix 2";
map[TagAnalogBalance] = "Analog Balance";
map[TagAsShotNeutral] = "As Shot Neutral";
map[TagAsShotWhiteXY] = "As Shot White XY";
map[TagBaselineExposure] = "Baseline Exposure";
map[TagBaselineNoise] = "Baseline Noise";
map[TagBaselineSharpness] = "Baseline Sharpness";
map[TagBayerGreenSplit] = "Bayer Green Split";
map[TagLinearResponseLimit] = "Linear Response Limit";
map[TagCameraSerialNumber] = "Camera Serial Number";
map[TagLensInfo] = "Lens Info";
map[TagChromaBlurRadius] = "Chroma Blur Radius";
map[TagAntiAliasStrength] = "Anti Alias Strength";
map[TagShadowScale] = "Shadow Scale";
map[TagDngPrivateData] = "DNG Private Data";
map[TagMakerNoteSafety] = "Maker Note Safety";
map[TagRawDataUniqueID] = "Raw Data Unique ID";
map[TagOriginalRawFileName] = "Original Raw File Name";
map[TagOriginalRawFileData] = "Original Raw File Data";
map[TagActiveArea] = "Active Area";
map[TagMaskedArea] = "Masked Area";
map[TagAsShotIccProfile] = "As Shot ICC Profile";
map[TagAsShotPreProfileMatrix] = "As Shot Pre-profile Matrix";
map[TagCurrentIccProfile] = "Current ICC Profile";
map[TagCurrentPreProfileMatrix] = "Current Pre-profile Matrix";
map[TagColorimetricReference] = "Colorimetric Reference";
map[TagCameraCalibrationSignature] = "Camera Calibration Signature";
map[TagProfileCalibrationSignature] = "Profile Calibration Signature";
map[TagExtraCameraProfiles] = "Extra Camera Profiles";
map[TagAsShotProfileName] = "As Shot Profile Name";
map[TagNoiseReductionApplied] = "Noise Reduction Applied";
map[TagProfileName] = "Profile Name";
map[TagProfileHueSatMapDims] = "Profile HSV Dimensions";
map[TagProfileHuseSatMapData1] = "Profile HSV Map 1";
map[TagProfileHuseSatMapData2] = "Profile HSV Map 2";
map[TagProfileToneCurve] = "Profile Tone Curve";
map[TagProfileEmbedPolicy] = "Profile Embed Policy";
map[TagProfileCopyright] = "Profile Copyright";
map[TagForwardMatrix1] = "Forward Matrix 1";
map[TagForwardMatrix2] = "Forward Matrix 2";
map[TagPreviewApplicationName] = "Preview Application Name";
map[TagPreviewApplicationVersion] = "Preview Application Version";
map[TagPreviewSettingsName] = "Preview Settings Name";
map[TagPreviewSettingsDigest] = "Preview Settings Digest";
map[TagPreviewColorSpace] = "Preview Color Space";
map[TagPreviewDateTime] = "Preview Date Time";
map[TagRawImageDigest] = "Raw Image Digest";
map[TagOriginalRawFileDigest] = "Original Raw File Digest";
map[TagSubTileBlockSize] = "Sub-tile Block Size";
map[TagRowInterleaveFactor] = "Row Interleave Factor";
map[TagProfileLookTableDims] = "Profile LookTable Dimensions";
map[TagProfileLookTableData] = "Profile LookTable Data";
map[TagOpcodeList1] = "Opcode List 1";
map[TagOpcodeList2] = "Opcode List 2";
map[TagOpcodeList3] = "Opcode List 3";
map[TagNoiseProfile] = "Noise Profile";
map[TagDefaultUserCrop] = "Default User Crop";
map[TagDefaultBlackRender] = "Default Black Render";
map[TagBaselineExposureOffset] = "Baseline Exposure Offset";
map[TagProfileLookTableEncoding] = "Profile LookTable Encoding";
map[TagProfileHueSatMapEncoding] = "Profile HueSatMap Encoding";
map[TagOriginalDefaultFinalSize] = "Original Default Final Size";
map[TagOriginalBestQualityFinalSize] = "Best Quality Final Size";
map[TagOriginalDefaultCropSize] = "Original Default Crop Size";
map[TagNewRawImageDigest] = "New Raw Image Digest";
map[TagRawToPreviewGain] = "Raw to Preview Gain";
}
}
}

0 comments on commit fa2d579

Please sign in to comment.