Skip to content

Commit

Permalink
Add DNG 1.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos authored and neheb committed Sep 27, 2023
1 parent d43d91e commit 8250fb2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
39 changes: 37 additions & 2 deletions src/tags_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ constexpr TagDetails exifCompression[] = {
{34712, N_("Leadtools JPEG 2000")},
{34713, N_("Nikon NEF Compressed")},
{34892, N_("JPEG (lossy)")}, // DNG 1.4
{52546, N_("JPEG XL")}, // DNG 1.7
{65000, N_("Kodak DCR Compressed")},
{65535, N_("Pentax PEF Compressed")},
};
Expand All @@ -283,8 +284,8 @@ constexpr TagDetails exifPhotometricInterpretation[] = {
{32844, N_("Pixar LogL")},
{32845, N_("Pixar LogLuv")},
{34892, N_("Linear Raw")},
{51177, N_("Depth Map")}, // DNG 1.5
{52527, N_("Semantic Mask")}, // DNG 1.6
{51177, N_("Depth Map")}, // DNG 1.5
{52527, N_("Photometric Mask")}, // DNG 1.6
};

//! Thresholding, tag 0x0107
Expand Down Expand Up @@ -404,6 +405,7 @@ constexpr TagDetails dngMakerNoteSafety[] = {
constexpr TagDetails dngColorimetricReference[] = {
{0, N_("XYZ values are scene-referred")},
{1, N_("XYZ values are output-referred")},
{2, N_("XYZ values are output-referred and may be HDR")}, // DNG 1.7
};

//! ProfileEmbedPolicy, DNG 1.2 tag 0xc6fd
Expand Down Expand Up @@ -451,6 +453,7 @@ constexpr TagDetails dngDepthMeasureType[] = {
{2, N_("Optical ray")},
};

// clang-format off
//! Base IFD Tags (IFD0 and IFD1)
constexpr TagInfo ifdTagInfo[] = {
{0x000b, "ProcessingSoftware", N_("Processing Software"),
Expand Down Expand Up @@ -1707,12 +1710,44 @@ constexpr TagInfo ifdTagInfo[] = {
"combination of the color tables, weighted by their corresponding Semantic "
"Masks."),
IfdId::ifd0Id, SectionId::dngTags, undefined, -1, printValue}, // DNG 1.6 tag
{0xcd40, "ProfileGainTableMap2", N_("Profile Gain Table Map 2"),
N_("This tag is an extended version of ProfileGainTableMap."),
IfdId::ifd0Id, SectionId::dngTags, undefined, -1, printValue}, // DNG 1.7 tag
{0xcd43, "ColumnInterleaveFactor", N_("Column Interleave Factor"),
N_("This tag specifies that columns of the image are stored in interleaved "
"order. The value of the tag specifies the number of interleaved fields. "
"The use of a non-default value for this tag requires setting the "
"DNGBackwardVersion tag to at least 1.7.0.0."),
IfdId::ifd0Id, SectionId::dngTags, unsignedLong, 1, printValue}, // DNG 1.7 tag
{0xcd44, "ImageSequenceInfo", N_("Image Sequence Info"),
N_("This is an informative tag that describes how the image file relates "
"to other image files captured in a sequence. Applications include focus "
"stacking, merging multiple frames to reduce noise, time lapses, exposure "
"brackets, stitched images for super resolution, and so on."),
IfdId::ifd0Id, SectionId::dngTags, undefined, -1, printValue}, // DNG 1.7 tag
{0xcd46, "ImageStats", N_("Image Stats"),
N_("This is an informative tag that provides basic statistical information "
"about the pixel values of the image in this IFD. Possible applications "
"include normalizing brightness of images when multiple images are displayed "
"together (especially when mixing Standard Dynamic Range and High Dynamic "
"Range images), identifying underexposed or overexposed images, and so on."),
IfdId::ifd0Id, SectionId::dngTags, undefined, -1, printValue}, // DNG 1.7 tag
{0xcd47, "ProfileDynamicRange", N_("Profile Dynamic Range"),
N_("This tag describes the intended rendering output dynamic range for a given "
"camera profile."),
IfdId::ifd0Id, SectionId::dngTags, undefined, 8, printValue}, // DNG 1.7 tag
{0xcd48, "ProfileGroupName", N_("Profile Group Name"),
N_("A UTF-8 encoded string containing the 'group name' of the camera profile. "
"The purpose of this tag is to associate two or more related camera profiles "
"into a common group."),
IfdId::ifd0Id, SectionId::dngTags, asciiString, -1, printValue}, // DNG 1.7 tag

////////////////////////////////////////
// End of list marker
{0xffff, "(UnknownIfdTag)", N_("Unknown IFD tag"), N_("Unknown IFD tag"), IfdId::ifd0Id, SectionId::sectionIdNotSet,
asciiString, -1, printValue},
};
// clang-format on

const TagInfo* ifdTagList() {
return ifdTagInfo;
Expand Down
2 changes: 1 addition & 1 deletion test/data/test_reference_files/IMG_1361.dng.out
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Exif.SubImage2.ImageWidth Long 1 2016 2016
Exif.SubImage2.ImageLength Long 1 1512 1512
Exif.SubImage2.BitsPerSample Short 1 8 8
Exif.SubImage2.Compression Short 1 34892 JPEG (lossy)
Exif.SubImage2.PhotometricInterpretation Short 1 52527 Semantic Mask
Exif.SubImage2.PhotometricInterpretation Short 1 52527 Photometric Mask
Exif.SubImage2.StripOffsets Long 1 5428540 5428540
Exif.SubImage2.SamplesPerPixel Short 1 1 1
Exif.SubImage2.RowsPerStrip Long 1 1512 1512
Expand Down
6 changes: 6 additions & 0 deletions test/data/test_reference_files/test_pr_1905_poc1_ref.out
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ MaskSubArea,52536,0xcd38,Image,Exif.Image.MaskSubArea,Long,"This tag identifies
ProfileHueSatMapData3,52537,0xcd39,Image,Exif.Image.ProfileHueSatMapData3,Float,"This tag contains the data for the third hue/saturation/value mapping table. Each entry of the table contains three 32-bit IEEE floating-point values. The first entry is hue shift in degrees; the second entry is saturation scale factor; and the third entry is a value scale factor. The table entries are stored in the tag in nested loop order, with the value divisions in the outer loop, the hue divisions in the middle loop, and the saturation divisions in the inner loop. All zero input saturation entries are required to have a value scale factor of 1.0."
ReductionMatrix3,52538,0xcd3a,Image,Exif.Image.ReductionMatrix3,SRational,"ReductionMatrix3 defines a dimensionality reduction matrix for use as the first stage in converting color camera native space values to XYZ values, under the third calibration illuminant. This tag may only be used if ColorPlanes is greater than 3. The matrix is stored in row scan order."
RGBTables,52539,0xcd3b,Image,Exif.Image.RGBTables,Undefined,"This tag specifies color transforms that can be applied to masked image regions. Color transforms are specified using RGB-to-RGB color lookup tables. These tables are associated with Semantic Masks to limit the color transform to a sub-region of the image. The overall color transform is a linear combination of the color tables, weighted by their corresponding Semantic Masks."
ProfileGainTableMap2,52544,0xcd40,Image,Exif.Image.ProfileGainTableMap2,Undefined,"This tag is an extended version of ProfileGainTableMap."
ColumnInterleaveFactor,52547,0xcd43,Image,Exif.Image.ColumnInterleaveFactor,Long,"This tag specifies that columns of the image are stored in interleaved order. The value of the tag specifies the number of interleaved fields. The use of a non-default value for this tag requires setting the DNGBackwardVersion tag to at least 1.7.0.0."
ImageSequenceInfo,52548,0xcd44,Image,Exif.Image.ImageSequenceInfo,Undefined,"This is an informative tag that describes how the image file relates to other image files captured in a sequence. Applications include focus stacking, merging multiple frames to reduce noise, time lapses, exposure brackets, stitched images for super resolution, and so on."
ImageStats,52550,0xcd46,Image,Exif.Image.ImageStats,Undefined,"This is an informative tag that provides basic statistical information about the pixel values of the image in this IFD. Possible applications include normalizing brightness of images when multiple images are displayed together (especially when mixing Standard Dynamic Range and High Dynamic Range images), identifying underexposed or overexposed images, and so on."
ProfileDynamicRange,52551,0xcd47,Image,Exif.Image.ProfileDynamicRange,Undefined,"This tag describes the intended rendering output dynamic range for a given camera profile."
ProfileGroupName,52552,0xcd48,Image,Exif.Image.ProfileGroupName,Ascii,"A UTF-8 encoded string containing the 'group name' of the camera profile. The purpose of this tag is to associate two or more related camera profiles into a common group."
ExposureTime,33434,0x829a,Photo,Exif.Photo.ExposureTime,Rational,"Exposure time, given in seconds (sec)."
FNumber,33437,0x829d,Photo,Exif.Photo.FNumber,Rational,"The F number."
ExposureProgram,34850,0x8822,Photo,Exif.Photo.ExposureProgram,Short,"The class of the program used by the camera to set exposure when the picture is taken."
Expand Down
2 changes: 1 addition & 1 deletion tests/bugfixes/github/test_pr_1436.py

Large diffs are not rendered by default.

0 comments on commit 8250fb2

Please sign in to comment.