Commit 121e3470 authored by Boudewijn Rempt's avatar Boudewijn Rempt

BUG:353572 Fix saving a jpg image with broken Exif info

I'm not sure what Photoshop is doing to exif these days, but more
and more jpg's are appearing that cause asserts in our metadata
code. In this case, we needed to check whether the array actually
had an entry.
parent d1f29601
......@@ -430,11 +430,13 @@ bool KisExifIO::saveTo(KisMetaData::Store* store, QIODevice* ioDevice, HeaderTyp
} else if (exivKey == "Exif.Photo.ComponentsConfiguration") {
v = kmdIntOrderedArrayToExifArray(entry.value());
} else if (exivKey == "Exif.Image.Artist") { // load as dc:creator
KisMetaData::Value creator = entry.value().asArray()[0];
if (entry.value().asArray().size() > 0) {
KisMetaData::Value creator = entry.value().asArray()[0];
#if EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION <= 20
v = kmdValueToExivValue(creator, Exiv2::ExifTags::tagType(exifKey.tag(), exifKey.ifdId()));
v = kmdValueToExivValue(creator, Exiv2::ExifTags::tagType(exifKey.tag(), exifKey.ifdId()));
#else
v = kmdValueToExivValue(creator, exifKey.defaultTypeId());
v = kmdValueToExivValue(creator, exifKey.defaultTypeId());
}
#endif
} else if (exivKey == "Exif.Photo.OECF") {
v = kmdOECFStructureToExifOECF(entry.value());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment