Better handle thumbnail generation of extreme aspect ratio images (fixes #3794)

* Backport fix taken from ART
* Enforce minimal thumbnail size of 1x1 px in two places, prevents divison by zero and empty image generation
This commit is contained in:
Floessie
2020-10-25 18:24:30 +01:00
committed by GitHub
parent b4f68adb64
commit 1318935a87
11 changed files with 82 additions and 57 deletions

View File

@@ -344,8 +344,9 @@ bool BatchQueue::loadBatchQueue ()
auto job = rtengine::ProcessingJob::create (source, thumb->getType () == FT_Raw, pparams, fast);
const auto prevh = getMaxThumbnailHeight ();
const auto prevw = thumb->getThumbnailWidth(prevh, &pparams);
auto prevh = getMaxThumbnailHeight();
auto prevw = prevh;
thumb->getThumbnailSize(prevw, prevh, &pparams);
auto entry = new BatchQueueEntry (job, pparams, source, prevw, prevh, thumb, options.overwriteOutputFile);
thumb->decreaseRef (); // Removing the refCount acquired by cacheMgr->getEntry