Issue 2456, revert to embedded thumb when profile is removed

This commit is contained in:
torger
2014-10-16 18:37:39 +02:00
parent 07e1b45928
commit 07e01dd355
2 changed files with 16 additions and 6 deletions

View File

@@ -88,12 +88,13 @@ void FileBrowserEntry::refreshThumbnailImage () {
}
void FileBrowserEntry::refreshQuickThumbnailImage () {
// Only make a (slow) processed preview if the picture has been edited at all
if ( thumbnail &&
thumbnail->isQuick() && (!options.internalThumbIfUntouched || thumbnail->isPParamsValid()) )
{
thumbImageUpdater->add(this, &updatepriority, true, this);
}
if (!thumbnail)
return;
// Only make a (slow) processed preview if the picture has been edited at all
bool upgrade_to_processed = (!options.internalThumbIfUntouched || thumbnail->isPParamsValid());
thumbImageUpdater->add(this, &updatepriority, upgrade_to_processed, this);
}
void FileBrowserEntry::calcThumbnailSize () {

View File

@@ -346,6 +346,15 @@ void Thumbnail::clearProcParams (int whoClearedIt) {
fname_ = removeExtension(fname) + paramFileExtension;
if (safe_file_test (fname_, Glib::FILE_TEST_EXISTS))
safe_g_remove (fname_);
if (cfs.format == FT_Raw && options.internalThumbIfUntouched && cfs.thumbImgType != CacheImageData::QUICK_THUMBNAIL) {
// regenerate thumbnail, ie load the quick thumb again. For the rare formats not supporting quick thumbs this will
// be a bit slow as a new full thumbnail will be generated unnecessarily, but currently there is no way to pre-check
// if the format supports quick thumbs.
initial_ = true;
_generateThumbnailImage();
initial_ = false;
}
}
} // end of mutex lock