Skip to content

Commit 9b51085

Browse files
committed
Revert "Revert "fix_1431_binary_comment.""
This reverts commit 2866415.
1 parent c616725 commit 9b51085

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

src/value.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -555,18 +555,6 @@ namespace Exiv2 {
555555
return os << comment();
556556
}
557557

558-
// test string for printable ascii-7 (' ' .. '~')
559-
static bool isBinary(const std::string& s)
560-
{
561-
bool result = false ;
562-
size_t i = 0;
563-
while ( !result && i < s.length() ) {
564-
unsigned char c = (unsigned char) s[i++];
565-
result = c < 32 || c > 127 ;
566-
}
567-
return result;
568-
}
569-
570558
std::string CommentValue::comment(const char* encoding) const
571559
{
572560
std::string c;
@@ -583,11 +571,6 @@ namespace Exiv2 {
583571
if ( bAscii && c.find('\0') != c.std::string::npos) {
584572
c = c.substr(0,c.find('\0'));
585573
}
586-
// return "binary comment" if results contains non-printable bytes
587-
// this ensures no binary bytes in the output stream.
588-
if ( bAscii && isBinary(c) ) {
589-
c = "binary comment" ;
590-
}
591574
return c;
592575
}
593576

test/data/exiv2-bug528.jpg

3 Bytes
Loading

tests/bugfixes/redmine/test_issue_528.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta):
3030
Exif.Image.YCbCrPositioning Short 1 Centered
3131
Exif.Image.Rating SLong 1 3
3232
Exif.Image.RatingPercent SLong 1 50
33-
Exif.Image.ExifTag Long 1 318
33+
Exif.Image.ExifTag Long 1 320
3434
Exif.Photo.ExposureTime Rational 1 1/250 s
3535
Exif.Photo.FNumber Rational 1 F11
3636
Exif.Photo.ExposureProgram Short 1 Auto
@@ -46,10 +46,10 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta):
4646
Exif.Photo.Flash Short 1 No, compulsory
4747
Exif.Photo.FocalLength Rational 1 10.0 mm
4848
Exif.Photo.MakerNote Undefined 18 0 1 2 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0
49-
Exif.MakerNote.Offset Long 1 796
49+
Exif.MakerNote.Offset Long 1 798
5050
Exif.MakerNote.ByteOrder Ascii 3 MM
5151
Exif.Canon.0x0200 0x0300 0
52-
Exif.Photo.UserComment Undefined 37 charset=Ascii binary comment
52+
Exif.Photo.UserComment Undefined 38 Chateaux de la Loire, Chambord
5353
Exif.Photo.SubSecTime Ascii 3 81
5454
Exif.Photo.SubSecTimeOriginal Ascii 3 81
5555
Exif.Photo.SubSecTimeDigitized Ascii 3 81
@@ -66,7 +66,7 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta):
6666
Exif.Photo.SceneCaptureType Short 1 Standard
6767
Exif.Photo.Contrast Short 1 Normal
6868
Exif.Photo.Saturation Short 1 Normal
69-
Exif.Image.GPSTag Long 1 867
69+
Exif.Image.GPSTag Long 1 870
7070
Exif.GPSInfo.GPSVersionID Byte 4 2.0.0.0
7171
Exif.GPSInfo.GPSLatitudeRef Ascii 2 North
7272
Exif.GPSInfo.GPSLatitude Rational 3 47deg 36' 58"
@@ -75,7 +75,7 @@ class TypeSizeForExifOnly(metaclass=system_tests.CaseMeta):
7575
Exif.GPSInfo.GPSAltitudeRef Byte 1 Above sea level
7676
Exif.GPSInfo.GPSAltitude Rational 1 86 m
7777
Exif.Thumbnail.Compression Short 1 JPEG (old-style)
78-
Exif.Thumbnail.JPEGInterchangeFormat Long 1 1055
78+
Exif.Thumbnail.JPEGInterchangeFormat Long 1 1058
7979
Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 4492
8080
""",
8181
"""File 1/1: $filename

0 commit comments

Comments
 (0)