Fix Exif parsing for old Canons (ported by @Beep6581, fixes #4843)

This commit is contained in:
Flössie
2019-03-10 11:40:05 +01:00
parent 2c9dc32022
commit d89364fcc0
2 changed files with 23 additions and 26 deletions

View File

@@ -1293,14 +1293,10 @@ FramesData::FramesData (const Glib::ustring& fname, std::unique_ptr<RawMetaDataL
FILE* f = g_fopen (fname.c_str (), "rb"); FILE* f = g_fopen (fname.c_str (), "rb");
if (f) { if (f) {
const bool has_rml_exif_base = rml->exifBase >= 0;
rtexif::ExifManager exifManager (f, std::move(rml), firstFrameOnly); rtexif::ExifManager exifManager (f, std::move(rml), firstFrameOnly);
if (has_rml_exif_base) {
if (exifManager.f && exifManager.rml) { if (exifManager.f && exifManager.rml) {
if (exifManager.rml->exifBase >= 0) { if (exifManager.rml->exifBase >= 0) {
exifManager.parseRaw (); exifManager.parseRaw ();
} else if (exifManager.rml->ciffBase >= 0) { } else if (exifManager.rml->ciffBase >= 0) {
exifManager.parseCIFF (); exifManager.parseCIFF ();
} }
@@ -1321,7 +1317,7 @@ FramesData::FramesData (const Glib::ustring& fname, std::unique_ptr<RawMetaDataL
break; break;
} }
} }
}
fclose (f); fclose (f);
} }
} else if (hasJpegExtension(fname)) { } else if (hasJpegExtension(fname)) {

View File

@@ -2116,6 +2116,7 @@ void ExifManager::parseCIFF ()
} }
parseCIFF (rml->ciffLength, root); parseCIFF (rml->ciffLength, root);
root->sort (); root->sort ();
parse(true);
} }
Tag* ExifManager::saveCIFFMNTag (TagDirectory* root, int len, const char* name) Tag* ExifManager::saveCIFFMNTag (TagDirectory* root, int len, const char* name)