From b6bf20a897091cc582d95c8aaa7e978cd01b96f2 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 11 Dec 2020 15:10:35 +0000 Subject: [PATCH] fix_1431_binary_comment. --- src/value.cpp | 17 ----------------- test/data/exiv2-bug528.jpg | Bin 10302 -> 10305 bytes tests/bugfixes/redmine/test_issue_528.py | 10 +++++----- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/value.cpp b/src/value.cpp index 5bd815e2..b96f7de3 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 cde81de25989a23fac62e7d3a0b4c032d216bf9e..4921b4076722cafe30b57ff0a949a86e12a53981 100644 GIT binary patch delta 302 zcmdlNa4=wkIODd765hOj7zG%Z7#JA%7#J9tCKiYr3NT7DumS}bfk=W;gMk^$1}b4R z1S{kQvJ@DNz-$p9TW8`9eL;r~RR$J_CgwB-2Ie0Ve<)6tU^JNQ&ZxwDtZ6RHM5c3- z%NX@-uT5Zq>1TR1k&%HNsFj70iJ4&%BLf%27^Z)dm|(h?*(R~T#F_afKVnpt6q{57 z)+GeAOm0#en5_n68%&mCisubm#1GdSH@S=H5XeIe43h(y#hG*zCTB9+N*(}u4CHSn gSC9+~SUJ$E%r_?QXBKDtF!?%jD5KJ5T^2zV0K1$l!~g&Q delta 337 zcmX>YurFYOIOFDt65hPO83h=a7#JA%7#J8CCl-hs@-s>^umS}bfk>QDgMk^$1}b4R z1S{kQvg8?!z-$p9TWjJDeL=epRR$J_Cgx-Y2Ij95e<)6tV$`4P#i+=8q-ie9M5Z&7 zD;V`{uS{Tp>1TQ|k&%HNsFj70iJ4&%BLf%27^Xjym|(h?SthZ-#F=>}KVejs6q!^5 z)+GeAOlDFWn5_zA>rGZ*isubp#1GdSJ-LVJkgQ{{v!^G}Wao^;lGMb~3WbzZg`7kM zpZv_CRIbT6%(jMmfj$KV1d}U}0D1-#20*_vUj?#&VFAVr3~X?7-%h^89Lgxa*?>h* F1pxWVGQ$7> diff --git a/tests/bugfixes/redmine/test_issue_528.py b/tests/bugfixes/redmine/test_issue_528.py index c17c49bb..b7ce0e8a 100644 --- a/tests/bugfixes/redmine/test_issue_528.py +++ b/tests/bugfixes/redmine/test_issue_528.py @@ -30,7 +30,7 @@ Exif.Image.DateTime Ascii 20 2008:04:14 08:24:04 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 @@ Exif.Photo.MeteringMode Short 1 Multi-segment 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 @@ Exif.Photo.WhiteBalance Short 1 Auto 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 @@ Exif.GPSInfo.GPSLongitude Rational 3 1deg 31' 1" 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