Added test for the type of the entries to decide if non-intrusive writing is possible. Fixes bug #452.

v0.27.3
Andreas Huggel 19 years ago
parent 748fc06fef
commit 687f9d9432

@ -1122,9 +1122,10 @@ namespace Exiv2 {
break;
}
// Make sure that the size of the Exifdatum fits the available size
// of the entry
// of the entry and the types are the same
if ( md->size() > rc.second->size()
|| md->sizeDataArea() > rc.second->sizeDataArea()) {
|| md->sizeDataArea() > rc.second->sizeDataArea()
|| md->typeId() != rc.second->type()) {
compatible = false;
break;
}

@ -54,6 +54,14 @@ num=447 # Problem only visible in Valgrind
filename=`prep_file $num`
$binpath/exiv2 -pi $filename
num=452
filename=exiv2-bug$num.jpg
cp -f ../data/exiv2-empty.jpg $filename
$binpath/exiv2 -v -M"set Exif.GPSInfo.GPSLatitude SRational -1/3 -2/3 -3/3" $filename
$binpath/exiv2 -pv $filename
$binpath/exiv2 -v -M"set Exif.GPSInfo.GPSLatitude Rational 1/3 2/3 3/3" $filename
$binpath/exiv2 -pv $filename
num=460
filename=`prep_file $num`
$binpath/exiv2 -pt $filename

@ -210,6 +210,14 @@ Warning: Exif tag 0x9286 has invalid Exif type 14; using 7 (undefined).
Iptc.Application2.Caption String 0
Iptc.Application2.DateCreated Date 8 2005-08-09
Iptc.Application2.TimeCreated Time 11 01:28:31-07:00
File 1/1: exiv2-bug452.jpg
Set Exif.GPSInfo.GPSLatitude "-1/3 -2/3 -3/3" (SRational)
0x8825 Image GPSTag Long 1 26
0x0002 GPSInfo GPSLatitude SRational 3 -1/3 -2/3 -3/3
File 1/1: exiv2-bug452.jpg
Set Exif.GPSInfo.GPSLatitude "1/3 2/3 3/3" (Rational)
0x8825 Image GPSTag Long 1 26
0x0002 GPSInfo GPSLatitude Rational 3 1/3 2/3 3/3
------> Bug 460 <-------
Exif.Image.XPTitle Byte 40 Titel und ähnliches
Exif.Image.XPComment Byte 46 And a standard comment

Loading…
Cancel
Save