Fixing test suite.
This commit is contained in:
parent
ecae9dc6eb
commit
23f39b60f7
@ -599,8 +599,16 @@ namespace Action {
|
||||
std::cout << " ";
|
||||
first = false;
|
||||
std::ostringstream os;
|
||||
// #1114 - show negative values for SByte
|
||||
if (md.typeId() == Exiv2::signedByte) {
|
||||
// 1431 always translate "comment" tags to show charset=
|
||||
// sadly md.key() cannot access tagInfo.typeId_ (== comment)
|
||||
Exiv2::StringSet commentTags;
|
||||
commentTags.insert("Exif.Photo.UserComment");
|
||||
commentTags.insert("Exif.GPSInfo.GPSProcessingMethod");
|
||||
commentTags.insert("Exif.GPSInfo.GPSAreaInformation");
|
||||
if ( commentTags.find(md.key()) != commentTags.end() ) {
|
||||
os << md.print(&pImage->exifData());
|
||||
} else if (md.typeId() == Exiv2::signedByte) {
|
||||
// #1114 - show negative values for SByte
|
||||
for ( int c = 0 ; c < md.value().count() ; c++ ) {
|
||||
int value = md.value().toLong(c);
|
||||
os << (c?" ":"") << std::dec << (value < 128 ? value : value - 256);
|
||||
|
||||
12
src/exif.cpp
12
src/exif.cpp
@ -225,18 +225,6 @@ namespace Exiv2 {
|
||||
// be careful with comments (User.Photo.UserComment, GPSAreaInfo etc).
|
||||
if ( ti ) {
|
||||
fct = ti->printFct_;
|
||||
if ( ti->typeId_ == comment ) {
|
||||
fct=NULL;
|
||||
const Exiv2::CommentValue* cv = dynamic_cast<const Exiv2::CommentValue*>(&value());
|
||||
Exiv2::CommentValue::CharsetId csId = cv->charsetId();
|
||||
if ( csId != CommentValue::undefined ) {
|
||||
os << "charset=" << CommentValue::CharsetInfo::name(csId) << " ";
|
||||
}
|
||||
os << cv->comment();
|
||||
#if 0
|
||||
os << "|| value().toString() = " << value().toString();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if ( fct ) fct(os, value(), pMetadata);
|
||||
return os;
|
||||
|
||||
@ -1776,7 +1776,7 @@ namespace Exiv2 {
|
||||
N_("A tag for Exif users to write keywords or comments on the image "
|
||||
"besides those in <ImageDescription>, and without the "
|
||||
"character code limitations of the <ImageDescription> tag."),
|
||||
exifId, userInfo, comment, 0, printValue),
|
||||
exifId, userInfo, comment, 0, printComment),
|
||||
TagInfo(0x9290, "SubSecTime", N_("Sub-seconds Time"),
|
||||
N_("A tag used to record fractions of seconds for the <DateTime> tag."),
|
||||
exifId, dateTime, asciiString, 0, printValue),
|
||||
@ -2204,11 +2204,11 @@ namespace Exiv2 {
|
||||
TagInfo(0x001b, "GPSProcessingMethod", N_("GPS Processing Method"),
|
||||
N_("A character string recording the name of the method used for location finding. "
|
||||
"The string encoding is defined using the same scheme as UserComment."),
|
||||
gpsId, gpsTags, comment, 0, printValue),
|
||||
gpsId, gpsTags, comment, 0, printComment),
|
||||
TagInfo(0x001c, "GPSAreaInformation", N_("GPS Area Information"),
|
||||
N_("A character string recording the name of the GPS area."
|
||||
"The string encoding is defined using the same scheme as UserComment."),
|
||||
gpsId, gpsTags, comment, 0, printValue),
|
||||
gpsId, gpsTags, comment, 0, printComment),
|
||||
TagInfo(0x001d, "GPSDateStamp", N_("GPS Date Stamp"),
|
||||
N_("A character string recording date and time information relative to UTC "
|
||||
"(Coordinated Universal Time). The format is \"YYYY:MM:DD.\"."),
|
||||
@ -2461,6 +2461,17 @@ namespace Exiv2 {
|
||||
return os << value;
|
||||
}
|
||||
|
||||
std::ostream& printComment(std::ostream& os, const Value& value, const ExifData*)
|
||||
{
|
||||
const Exiv2::CommentValue* cv = dynamic_cast<const Exiv2::CommentValue*>(&value);
|
||||
Exiv2::CommentValue::CharsetId csId = cv->charsetId();
|
||||
if ( csId != CommentValue::undefined ) {
|
||||
os << "charset=" << CommentValue::CharsetInfo::name(csId) << " ";
|
||||
}
|
||||
os << cv->comment();
|
||||
return os ;
|
||||
}
|
||||
|
||||
std::ostream& printBitmask(std::ostream& os, const Value& value, const ExifData* metadata)
|
||||
{
|
||||
if (value.typeId() == Exiv2::unsignedShort || value.typeId() == Exiv2::signedShort)
|
||||
|
||||
@ -362,6 +362,8 @@ namespace Exiv2 {
|
||||
//@{
|
||||
//! Default print function, using the Value output operator
|
||||
std::ostream& printValue(std::ostream& os, const Value& value, const ExifData*);
|
||||
//! Print the value of a comment
|
||||
std::ostream& printComment(std::ostream& os, const Value& value, const ExifData*);
|
||||
//! Print the value converted to a long
|
||||
std::ostream& printLong(std::ostream& os, const Value& value, const ExifData*);
|
||||
//! Print a Rational or URational value in floating point format
|
||||
|
||||
@ -819,7 +819,7 @@ Exif.NikonFl1.0x0011 0x0011 Makernote Byte 3
|
||||
Exif.Nikon3.ImageOptimization 0x00a9 Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.Saturation 0x00aa Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.VariProgram 0x00ab Makernote Ascii 16
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44 charset=Ascii
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44
|
||||
Exif.Photo.SubSecTime 0x9290 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeOriginal 0x9291 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeDigitized 0x9292 Exif Ascii 3 00
|
||||
@ -990,7 +990,7 @@ Exif.NikonFl1.0x0011 0x0011 Makernote Byte 3
|
||||
Exif.Nikon3.ImageOptimization 0x00a9 Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.Saturation 0x00aa Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.VariProgram 0x00ab Makernote Ascii 16
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44 charset=Ascii
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44
|
||||
Exif.Photo.SubSecTime 0x9290 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeOriginal 0x9291 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeDigitized 0x9292 Exif Ascii 3 00
|
||||
@ -1162,7 +1162,7 @@ Exif.NikonFl1.0x0011 0x0011 Makernote Byte 3
|
||||
Exif.Nikon3.ImageOptimization 0x00a9 Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.Saturation 0x00aa Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.VariProgram 0x00ab Makernote Ascii 16
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44 charset=Ascii
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44
|
||||
Exif.Photo.SubSecTime 0x9290 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeOriginal 0x9291 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeDigitized 0x9292 Exif Ascii 3 00
|
||||
@ -1334,7 +1334,7 @@ Exif.NikonFl1.0x0011 0x0011 Makernote Byte 3
|
||||
Exif.Nikon3.ImageOptimization 0x00a9 Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.Saturation 0x00aa Makernote Ascii 16 NORMAL
|
||||
Exif.Nikon3.VariProgram 0x00ab Makernote Ascii 16
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44 charset=Ascii
|
||||
Exif.Photo.UserComment 0x9286 Exif Undefined 44
|
||||
Exif.Photo.SubSecTime 0x9290 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeOriginal 0x9291 Exif Ascii 3 00
|
||||
Exif.Photo.SubSecTimeDigitized 0x9292 Exif Ascii 3 00
|
||||
|
||||
Loading…
Reference in New Issue
Block a user