diff --git a/src/value.cpp b/src/value.cpp index 5bd815e2e7..b96f7de350 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -555,18 +555,6 @@ namespace Exiv2 { return os << comment(); } - // test string for printable ascii-7 (' ' .. '~') - static bool isBinary(const std::string& s) - { - bool result = false ; - size_t i = 0; - while ( !result && i < s.length() ) { - unsigned char c = (unsigned char) s[i++]; - result = c < 32 || c > 127 ; - } - return result; - } - std::string CommentValue::comment(const char* encoding) const { std::string c; @@ -583,11 +571,6 @@ namespace Exiv2 { if ( bAscii && c.find('\0') != c.std::string::npos) { c = c.substr(0,c.find('\0')); } - // return "binary comment" if results contains non-printable bytes - // this ensures no binary bytes in the output stream. - if ( bAscii && isBinary(c) ) { - c = "binary comment" ; - } return c; } diff --git a/test/data/exiv2-bug528.jpg b/test/data/exiv2-bug528.jpg index cde81de259..4921b40767 100644 Binary files a/test/data/exiv2-bug528.jpg and b/test/data/exiv2-bug528.jpg differ diff --git a/tests/bugfixes/redmine/test_issue_528.py b/tests/bugfixes/redmine/test_issue_528.py index c17c49bbd4..b7ce0e8a2c 100644 --- a/tests/bugfixes/redmine/test_issue_528.py +++ b/tests/bugfixes/redmine/test_issue_528.py @@ -30,7 +30,7 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta): Exif.Image.YCbCrPositioning Short 1 Centered Exif.Image.Rating SLong 1 3 Exif.Image.RatingPercent SLong 1 50 -Exif.Image.ExifTag Long 1 318 +Exif.Image.ExifTag Long 1 320 Exif.Photo.ExposureTime Rational 1 1/250 s Exif.Photo.FNumber Rational 1 F11 Exif.Photo.ExposureProgram Short 1 Auto @@ -46,10 +46,10 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta): Exif.Photo.Flash Short 1 No, compulsory Exif.Photo.FocalLength Rational 1 10.0 mm Exif.Photo.MakerNote Undefined 18 0 1 2 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 -Exif.MakerNote.Offset Long 1 796 +Exif.MakerNote.Offset Long 1 798 Exif.MakerNote.ByteOrder Ascii 3 MM Exif.Canon.0x0200 0x0300 0 -Exif.Photo.UserComment Undefined 37 charset=Ascii binary comment +Exif.Photo.UserComment Undefined 38 Chateaux de la Loire, Chambord Exif.Photo.SubSecTime Ascii 3 81 Exif.Photo.SubSecTimeOriginal Ascii 3 81 Exif.Photo.SubSecTimeDigitized Ascii 3 81 @@ -66,7 +66,7 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta): Exif.Photo.SceneCaptureType Short 1 Standard Exif.Photo.Contrast Short 1 Normal Exif.Photo.Saturation Short 1 Normal -Exif.Image.GPSTag Long 1 867 +Exif.Image.GPSTag Long 1 870 Exif.GPSInfo.GPSVersionID Byte 4 2.0.0.0 Exif.GPSInfo.GPSLatitudeRef Ascii 2 North Exif.GPSInfo.GPSLatitude Rational 3 47deg 36' 58" @@ -75,7 +75,7 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta): Exif.GPSInfo.GPSAltitudeRef Byte 1 Above sea level Exif.GPSInfo.GPSAltitude Rational 1 86 m Exif.Thumbnail.Compression Short 1 JPEG (old-style) -Exif.Thumbnail.JPEGInterchangeFormat Long 1 1055 +Exif.Thumbnail.JPEGInterchangeFormat Long 1 1058 Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 4492 """, """File 1/1: $filename