#662: Fixes by Leo Sutic. Added carriage return to the special characters.

v0.27.3
Andreas Huggel 16 years ago
parent d3068c8c69
commit 942d217e89

@ -625,7 +625,7 @@ namespace Action {
&& ( md.typeId() == Exiv2::undefined
|| md.typeId() == Exiv2::unsignedByte
|| md.typeId() == Exiv2::signedByte)
&& md.size() > 100) {
&& md.size() > 128) {
std::cout << _("(Binary value suppressed)") << std::endl;
return;
}
@ -638,7 +638,7 @@ namespace Action {
&& ( md.typeId() == Exiv2::undefined
|| md.typeId() == Exiv2::unsignedByte
|| md.typeId() == Exiv2::signedByte)
&& md.size() > 100) {
&& md.size() > 128) {
std::cout << _("(Binary value suppressed)") << std::endl;
return;
}
@ -651,7 +651,7 @@ namespace Action {
&& ( md.typeId() == Exiv2::undefined
|| md.typeId() == Exiv2::unsignedByte
|| md.typeId() == Exiv2::signedByte)
&& md.size() > 100) {
&& md.size() > 128) {
std::cout << _("(Binary value suppressed)") << std::endl;
return;
}

@ -1325,7 +1325,6 @@ namespace Exiv2 {
std::string outstr;
EXV_ICONV_CONST char *inptr = const_cast<char *>(str.c_str());
size_t inbytesleft = str.length();
int outbytesProduced = 0;
while (inbytesleft) {
char outbuf[100];
char *outptr = outbuf;
@ -1335,7 +1334,7 @@ namespace Exiv2 {
&inbytesleft,
&outptr,
&outbytesleft);
outbytesProduced += sizeof(outbuf) - 1 - outbytesleft;
int outbytesProduced = sizeof(outbuf) - 1 - outbytesleft;
if (rc == size_t(-1) && errno != E2BIG) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: iconv: "

@ -1131,23 +1131,19 @@ namespace {
++i;
ch = input[i];
switch (ch) {
// Escaping of backslash
case '\\':
case '\\': // Escaping of backslash
result.push_back('\\');
break;
// Escaping of newline
case 'n':
case 'r': // Escaping of carriage return
result.push_back('\r');
break;
case 'n': // Escaping of newline
result.push_back('\n');
break;
// Escaping of tab
case 't':
case 't': // Escaping of tab
result.push_back('\t');
break;
// Escaping of unicode
case 'u':
case 'u': // Escaping of unicode
if (input.length() - 4 > i) {
int acc = 0;
for (int j = 0; j < 4; ++j) {
@ -1186,7 +1182,6 @@ namespace {
result.push_back(ch);
}
break;
default:
result.push_back('\\');
result.push_back(ch);

@ -2515,17 +2515,14 @@ namespace Exiv2 {
return os;
}
// Todo: Implement this properly
std::ostream& print0x9286(std::ostream& os, const Value& value, const ExifData*)
{
if (value.size() > 8) {
DataBuf buf(value.size());
value.copy(buf.pData_, bigEndian);
// Hack: Skip the leading 8-Byte character code, truncate
// trailing '\0's and let the stream take care of the remainder
std::string userComment(reinterpret_cast<char*>(buf.pData_) + 8, buf.size_ - 8);
std::string::size_type pos = userComment.find_last_not_of('\0');
os << userComment.substr(0, pos + 1);
const CommentValue* pcv = dynamic_cast<const CommentValue*>(&value);
if (pcv) {
os << pcv->value_;
}
else {
os << value;
}
return os;
}

@ -217,7 +217,7 @@ $exiv2 -pi v.jpg
# ----------------------------------------------------------------------
# Evaluate results
cat $results | sed 's/\x0d$//' > $results-stripped
cat $results | sed 's/\x0d$//' | tr '\033' '$' > $results-stripped
diff -q $results-stripped $good
rc=$?
if [ $rc -eq 0 ] ; then

Binary file not shown.

@ -3,21 +3,21 @@ Testcase 1
Xmp.dc.description LangAlt 1 lang="x-default" The Exif image description
Exif.Image.ImageDescription Ascii 27 The Exif image description
Iptc.Application2.Caption String 26 The Exif image description
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 2
==========
Xmp.dc.description LangAlt 1 lang="x-default" The Exif image description
Exif.Image.ImageDescription Ascii 27 The Exif image description
Iptc.Application2.Caption String 26 The Exif image description
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 3
==========
Xmp.dc.description LangAlt 1 lang="de-DE" The Exif image description
Exif.Image.ImageDescription Ascii 27 The Exif image description
Iptc.Application2.Caption String 26 The Exif image description
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 4
==========
@ -37,14 +37,14 @@ Warning: Failed to convert Xmp.dc.description to Exif.Image.ImageDescription
Xmp.dc.description LangAlt 3 lang="x-default" How to fix this mess, lang="de-DE" The Exif image description, lang="it-IT" Ciao bella
Exif.Image.ImageDescription Ascii 21 How to fix this mess
Iptc.Application2.Caption String 20 How to fix this mess
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 6
==========
Exif.Image.ExifTag Long 1 26
Exif.Photo.UserComment Undefined 59 charset="Jis" This is a JIS encoded Exif user comment. Or was it?
Xmp.exif.UserComment LangAlt 1 lang="x-default" This is a JIS encoded Exif user comment. Or was it?
Exif.Photo.UserComment Undefined 59 charset="Unicode" This is a JIS encoded Exif user comment. Or was it?
Exif.Photo.UserComment Undefined 110 charset="Unicode" This is a JIS encoded Exif user comment. Or was it?
File 1/1: m.xmp
m.xmp: No IPTC data found in the file
@ -52,7 +52,7 @@ Testcase 7
==========
Xmp.exif.UserComment LangAlt 1 lang="x-default" This is a JIS encoded Exif user comment. Or was it?
Exif.Image.ExifTag Long 1 26
Exif.Photo.UserComment Undefined 59 charset="Unicode" This is a JIS encoded Exif user comment. Or was it?
Exif.Photo.UserComment Undefined 110 charset="Unicode" This is a JIS encoded Exif user comment. Or was it?
File 1/1: n.jpg
n.jpg: No IPTC data found in the file
@ -67,7 +67,7 @@ o.xmp: No Exif data found in the file
Iptc.Application2.Keywords String 3 Sex
Iptc.Application2.Keywords String 5 Drugs
Iptc.Application2.Keywords String 11 Rock'n'roll
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 9
==========
@ -77,7 +77,7 @@ p.jpg: No Exif data found in the file
Iptc.Application2.Keywords String 3 Sex
Iptc.Application2.Keywords String 5 Drugs
Iptc.Application2.Keywords String 11 Rock'n'roll
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 10
===========
@ -101,7 +101,7 @@ Xmp.iptc.Location XmpText 12 Kuala Lumpur
File 1/1: s.xmp
s.xmp: No Exif data found in the file
Iptc.Application2.SubLocation String 12 Kuala Lumpur
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 13
===========
@ -109,7 +109,7 @@ Xmp.iptc.Location XmpText 12 Kuala Lumpur
File 1/1: t.jpg
t.jpg: No Exif data found in the file
Iptc.Application2.SubLocation String 12 Kuala Lumpur
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 14
===========
@ -149,7 +149,7 @@ Exif.GPSInfo.GPSLatitudeRef Ascii 2 N
Exif.GPSInfo.GPSTimeStamp Rational 3 1/1 2/1 999999999/1000000000
Exif.GPSInfo.GPSDateStamp Ascii 11 2003:12:14
Iptc.Application2.DateCreated Date 8 2007-05-09
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G
Testcase 15
===========
@ -181,4 +181,4 @@ Exif.GPSInfo.GPSLatitude Rational 3 3/1 8/1 1858407/6250
Exif.GPSInfo.GPSTimeStamp Rational 3 1/1 2/1 999999999/1000000000
Exif.GPSInfo.GPSDateStamp Ascii 11 2003:12:14
Iptc.Application2.DateCreated Date 8 2007-05-09
Iptc.Envelope.CharacterSet String 3 %G
Iptc.Envelope.CharacterSet String 3 $%G

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save