Remove unnecessary thumbnail loading code

This commit is contained in:
xiota
2021-09-23 14:02:54 -07:00
parent dd01cc110b
commit 320859bf92

View File

@@ -184,7 +184,6 @@ Glib::ustring Thumbnail::xmpSidecarPath(const Glib::ustring &imagePath)
void Thumbnail::_generateThumbnailImage () void Thumbnail::_generateThumbnailImage ()
{ {
// delete everything loaded into memory // delete everything loaded into memory
delete tpp; delete tpp;
tpp = nullptr; tpp = nullptr;
@@ -205,35 +204,6 @@ void Thumbnail::_generateThumbnailImage ()
cfs.exifValid = false; cfs.exifValid = false;
cfs.timeValid = false; cfs.timeValid = false;
if (ext == "jpg" || ext == "jpeg") {
infoFromImage (fname);
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, -1, pparams->wb.equal, pparams->wb.observer);
if (tpp) {
cfs.format = FT_Jpeg;
}
} else if (ext == "png") {
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, -1, pparams->wb.equal, pparams->wb.observer);
if (tpp) {
cfs.format = FT_Png;
}
#ifdef LIBJXL
} else if (ext == "jxl") {
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, -1, pparams->wb.equal);
if (tpp) {
cfs.format = FT_Custom;
}
#endif
} else if (ext == "tif" || ext == "tiff") {
infoFromImage (fname);
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, -1, pparams->wb.equal, pparams->wb.observer);
if (tpp) {
cfs.format = FT_Tiff;
}
} else {
// RAW works like this: // RAW works like this:
// 1. if we are here it's because we aren't in the cache so load the JPG // 1. if we are here it's because we aren't in the cache so load the JPG
// image out of the RAW. Mark as "quick". // image out of the RAW. Mark as "quick".
@@ -261,11 +231,10 @@ void Thumbnail::_generateThumbnailImage ()
cfs.height = tpp->full_height; cfs.height = tpp->full_height;
} }
} }
}
if (!tpp) { if (!tpp) {
// try a custom loader // this will load formats supported by imagio (jpg, png, jxl, and tiff)
tpp = rtengine::Thumbnail::loadFromImage(fname, tw, th, -1, pparams->wb.equal, true); tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, -1, pparams->wb.equal, pparams->wb.observer);
if (tpp) { if (tpp) {
cfs.format = FT_Custom; cfs.format = FT_Custom;
infoFromImage(fname); infoFromImage(fname);