Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_929_exif2.32 (0.27->master) #1389

Merged
merged 6 commits into from
Nov 21, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion src/tags_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,13 @@ namespace Exiv2 {
N_("Contains four ASCII characters representing the TIFF/EP standard "
"version of a TIFF/EP file, eg '1', '0', '0', '0'"),
ifd0Id, tiffEp, unsignedByte, 4, printValue), // TIFF/EP Tag
TagInfo(0x9217, "SensingMethod", N_("Sensing Method"), N_("Type of image sensor."), ifd0Id, tiffEp, unsignedShort, 1, printValue), // TIFF/EP tag
TagInfo(0x9217, "SensingMethod", N_("Sensing Method"), N_("Type of image sensor."), exifId, tiffEp, unsignedShort, 1, printValue), // TIFF/EP tag
Copy link
Collaborator

@kmilos kmilos Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x9217 should stay associated w/ ifd0Id, this one is TIFF/EP specific. There is a separate (and equivalent) 0xa217 for the Exif IFD.

But this one should probably also use print0xa217. Slightly different unfortunately, we need new translation values :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's use print0xa217().

TagInfo(0x9400, "Temperature", N_("Temperature"), N_("Temperature as the ambient situation at the shot, for example the room temperature where the photographer was holding the camera. The unit is degrees C"), exifId, captureCond, signedRational, 1, printValue), // Exif 2.31
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still think tags 0x9400 to 0x9405 should be moved to exifTagInfo[] (just like OffsetTime etc.), they really are Exif specific.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. You are totally correct. Yes. Let's do that.

TagInfo(0x9401, "Humidity", N_("Humidity"), N_("Humidity as the ambient situation at the shot, for example the room humidity where the photographer was holding the camera. The unit is %."), exifId, captureCond, unsignedRational, 1, printValue), // Exif 2.31
TagInfo(0x9402, "Pressure", N_("Pressure"), N_("Pressure as the ambient situation at the shot, for example the room atmospfere where the photographer was holding the camera or the water pressure under the sea. The unit is hPa."), exifId, captureCond, unsignedRational, 1, printValue), // Exif 2.31
TagInfo(0x9403, "WaterDepth", N_("WaterDepth"), N_("Water depth as the ambient situation at the shot, for example the water depth of the camera at underwater photography. The unit is m."), exifId, captureCond, signedRational, 1, printValue), // Exif 2.31
TagInfo(0x9404, "Acceleration", N_("Acceleration"), N_("Acceleration (a scalar regardless of direction) as the ambient situation at the shot, for example the driving acceleration of the vehicle which the photographer rode on at the shot. The unit is mGal (10-5 m/s2). "), exifId, captureCond, unsignedRational, 1, printValue), // Exif 2.31
TagInfo(0x9405, "CameraElevationAngle", N_("Camera elevation angle"), N_("Elevation/depression. angle of the orientation of the camera(imaging optical axis) as the ambient situation at the shot. The unit is degrees."), exifId, captureCond, signedRational, 1, printValue), // Exif 2.31
TagInfo(0x9c9b, "XPTitle", N_("Windows Title"),
N_("Title tag used by Windows, encoded in UCS2"),
ifd0Id, otherTags, unsignedByte, -1, printUcs2), // Windows Tag
Expand Down Expand Up @@ -1500,6 +1506,15 @@ namespace Exiv2 {
TagInfo(0x9004, "DateTimeDigitized", N_("Date and Time (digitized)"),
N_("The date and time when the image was stored as digital data."),
exifId, dateTime, asciiString, 20, printValue),
TagInfo(0x9010, "OffsetTime", N_("Offset Time"),
N_("Time difference from Universal Time Coordinated including daylight saving time of DateTime tag."),
exifId, dateTime, asciiString, 7, printValue), // Exif 2.31
TagInfo(0x9011, "OffsetTimeOriginal", N_("Offset Time Original"),
N_("Time difference from Universal Time Coordinated including daylight saving time of DateTimeOriginal tag."),
exifId, dateTime, asciiString, 7, printValue), // Exif 2.31
TagInfo(0x9012, "OffsetTimeDigitized", N_("Offset Time Digitized"),
N_("Time difference from Universal Time Coordinated including daylight saving time of DateTimeDigitized tag."),
exifId, dateTime, asciiString, 7, printValue), // Exif 2.31
TagInfo(0x9101, "ComponentsConfiguration", N_("Components Configuration"),
N_("Information specific to compressed data. The channels of "
"each component are arranged in order from the 1st "
Expand Down Expand Up @@ -1752,6 +1767,15 @@ namespace Exiv2 {
N_("This tag records the serial number of the interchangeable lens "
"that was used in photography as an ASCII string."),
exifId, otherTags, asciiString, 0, printValue),
TagInfo(0xa460, "CompositeImage", N_("Composite Image"), // Exif 2.32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer comments after TagInfo() closing parenthesis for the next 3 tags, like in the rest of the code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I've understood your comment.

N_("Indicates whether the recorded image is a composite image or not."),
exifId, captureCond, unsignedShort, 1, printCompositeImage),
TagInfo(0xa461, "SourceImageNumberOfCompositeImage", N_("Source Image Number Of Composite Image"), // Exif 2.32
N_("Indicates the number of the source images (tentatively recorded images) captured for a composite Image."),
exifId, captureCond, unsignedShort, 2, printValue),
TagInfo(0xa462, "SourceExposureTimesOfCompositeImage", N_("Source Exposure Times Of Composite Image"), // Exif 2.32
N_("For a composite image, records the parameters relating exposure time of the exposures for generating the said composite image, such as respective exposure times of captured source images (tentatively recorded images)."),
exifId, captureCond, undefined, 0, printValue),
// End of list marker
TagInfo(0xffff, "(UnknownExifTag)", N_("Unknown Exif tag"),
N_("Unknown Exif tag"),
Expand Down Expand Up @@ -1925,6 +1949,9 @@ namespace Exiv2 {
TagInfo(0x001e, "GPSDifferential", N_("GPS Differential"),
N_("Indicates whether differential correction is applied to the GPS receiver."),
gpsId, gpsTags, unsignedShort, 1, print0x001e),
TagInfo(0x001f, "GPSHPositioningError", N_("GPS Horizontal positioning error"),
N_("This tag indicates horizontal positioning errors in meters."),
gpsId, gpsTags, unsignedRational, 1, printValue),
// End of list marker
TagInfo(0xffff, "(UnknownGpsTag)", N_("Unknown GPSInfo tag"),
N_("Unknown GPSInfo tag"),
Expand Down Expand Up @@ -2833,6 +2860,18 @@ namespace Exiv2 {
return EXV_PRINT_TAG(exifNormalSoftHard)(os, value, metadata);
}

extern const TagDetails exifCompositeImage[] = {
{ 0, N_("Unknown") },
{ 1, N_("NonComposite") },
{ 2, N_("GeneralComposite") },
{ 3, N_("CompositeCapturedWhenShooting") }
};

std::ostream& printCompositeImage(std::ostream& os, const Value& value, const ExifData* metadata)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the macro EXV_PRINT_TAG() instead, no need to clutter the API with functions that are almost never used...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. The code was cut'n'pasted without really thinking/understanding how everything fits together. We shouldn't add function to the API without good reason.

{
return EXV_PRINT_TAG(exifCompositeImage)(os, value, metadata);
}

std::ostream& printExifVersion(std::ostream& os, const Value& value, const ExifData*)
{
if (value.size() != 4 || value.typeId() != undefined) {
Expand Down
26 changes: 22 additions & 4 deletions src/tags_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,26 @@ namespace Exiv2 {
of nothing more than a name, based on the Exif standard.
*/
enum SectionId { sectionIdNotSet,
imgStruct, recOffset, imgCharacter, otherTags, exifFormat,
exifVersion, imgConfig, userInfo, relatedFile, dateTime,
captureCond, gpsTags, iopTags, mpfTags, makerTags, dngTags, panaRaw,
tiffEp, tiffPm6, adobeOpi,
imgStruct, // 4.6.4 A
recOffset, // 4.6.4 B
imgCharacter, // 4.6.4 C
otherTags, // 4.6.4 D
exifFormat, // 4.6.3
exifVersion, // 4.6.5 A
imgConfig, // 4.6.5 C
userInfo, // 4.6.5 D
relatedFile, // 4.6.5 E
dateTime, // 4.6.5 F
captureCond, // 4.6.5 G
gpsTags, // 4.6.6
iopTags, // 4.6.7
mpfTags,
makerTags, // MakerNote
dngTags, // DNG Spec
panaRaw,
tiffEp, // TIFF-EP Spec
tiffPm6,
adobeOpi,
lastSectionId };

//! The details of a section.
Expand Down Expand Up @@ -434,6 +450,8 @@ namespace Exiv2 {
std::ostream& printGPSDirRef(std::ostream& os, const Value& value, const ExifData*);
//! Print contrast, sharpness (normal, soft, hard)
std::ostream& printNormalSoftHard(std::ostream& os, const Value& value, const ExifData*);
//! Print compositeImage (unknown, nonComposite, generalComposite,compositeCapturedWhenShooting)
std::ostream& printCompositeImage(std::ostream& os, const Value& value, const ExifData*);
//! Print any version packed in 4 Bytes format : major major minor minor
std::ostream& printExifVersion(std::ostream& os, const Value& value, const ExifData*);
//! Print any version encoded in the ASCII string majormajorminorminor
Expand Down