Modified fixiso to handle Canon tags as well.

v0.27.3
Andreas Huggel 18 years ago
parent a586c7f947
commit 3c17cb4dec

@ -1532,8 +1532,18 @@ namespace Action {
<< ": " << _("No Exif data found in the file\n");
return -3;
}
Exiv2::ExifKey key("Exif.Nikon3.ISOSpeed");
// Check if the standard tag exists
Exiv2::ExifKey key("Exif.Photo.ISOSpeedRatings");
Exiv2::ExifData::iterator md = exifData.findKey(key);
if (md != exifData.end()) {
if (Params::instance().verbose_) {
std::cout << _("Standard Exif ISO tag exists; not modified\n");
}
return 0;
}
// Fix Nikon ISO setting
key = Exiv2::ExifKey("Exif.Nikon3.ISOSpeed");
md = exifData.findKey(key);
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.Nikon2.ISOSpeed");
md = exifData.findKey(key);
@ -1542,6 +1552,16 @@ namespace Action {
key = Exiv2::ExifKey("Exif.Nikon1.ISOSpeed");
md = exifData.findKey(key);
}
// Canon has a similar bad habit, fix that too
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.CanonSi.ISOSpeed");
md = exifData.findKey(key);
}
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.CanonCs.ISOSpeed");
md = exifData.findKey(key);
}
// Copy the proprietary tag to the standard place
if (md != exifData.end()) {
std::ostringstream os;
os << *md;

@ -3,7 +3,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH EXIV2 1 "November 1st, 2007"
.TH EXIV2 1 "December 12th, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -73,9 +73,10 @@ filename format can be set with \fB\-r\fP \fIfmt\fP, timestamp options
are \fB\-t\fP and \fB\-T\fP.
.TP
.B fi | fixiso
Copy the ISO setting from any of the proprietary Nikon makernote ISO
tags to the regular Exif ISO tag, Exif.Photo.ISOSpeedRatings. Overwrites
an existing Exif ISO tag.
Copy the ISO setting from one of the proprietary Nikon or Canon
makernote ISO tags to the regular Exif ISO tag,
Exif.Photo.ISOSpeedRatings. Does not overwrite an existing standard
Exif ISO tag.
.SH OPTIONS
.TP
.B \-h
@ -303,6 +304,14 @@ that for IPTC \fBTime\fP values is HH:MM:SS+|\-HH:MM, where HH:MM:SS
refers to local hour, minute and seconds and +|\-HH:MM refers to hours
and minutes ahead or behind Universal Coordinated Time (+|\- means
either a + or a \- sign is required).
.sp 1
The format of XMP \fBLangAlt\fP values includes an optional language
qualifier:
.sp 1
.B [lang=\fIlanguage-code\fP ]\fItext\fP
.sp 1
.B x-default
is used by default if the value doesn't start with a language qualifier.
.TP
An additional command is available to register XMP namespaces:
.TP
@ -363,7 +372,7 @@ make sense in the target image.
.SH SEE ALSO
.TP
.I http://www.exiv2.org/sample.html#modify
Sample command file.
Sample command files.
.TP
.I http://www.exiv2.org/metadata.html
Taglists with \fIkey\fP and default \fItype\fP values.

Loading…
Cancel
Save