local contrast (local laplacian) display bug when changing image
In darkroom, with the local contrast tool (new default mode: local laplacian), when switching from an image to another, I get a strange display bug: it seems darktable computes a mask for an image, and re-uses the mask when displaying the next image.
See example attached. Screenshots done with two images (image 1 and image 2), switching back and forth between the images.
The display bug disappears as soon as I move or zoom the image (i.e. when a new computation is triggered).
Thanks in advance,
bilat: don't grab data from preview pipe if hash==0, fixes #11872
When changing image in darkroom, and when both the previous and the new
image have local laplacian activated, the optimization grabing data from
the preview pixelpipe introduced in 911133c (local laplacian: make roi
aware in darkroom mode, 2017-10-15) was actually grabing data from the
previously selected image.
The guilty line was:
if(hash != 0 && !dt_dev_sync_...)
in case hash == 0, the sync is not done, but the else branch still
does the grabbing. Change this to exhibit 3 cases: 1) don't try to
sync and grab, 2) sync failure, 3) sync success.
#2 Updated by Matthieu Moy about 1 year ago
I found the guilty code:
If I replace the
if (... < 0.9) by
if (... < 0.0) (always false), then the issue disappears. What happens is that the full pipeline steals data from the preview pipeline, and apparently it steals it from the previously computed image.
According to gdb, the visual bug happens when
hash is 0, i.e. when the
if (hash != 0 && dt_dev_sync...) condition is false because of the left hand side of the
&&. Then, the pipeline sync is not done, but the stealing from the preview pipeline still happens (
I don't fully understand the logic here, but I'll try a naive fix (at least it should be simpler for a core dev to finish debugging/fixing with this initial attempt).
- % Done changed from 0 to 100
- Status changed from New to Fixed
Applied in changeset darktable|bfe9911ad0ca54e76b6faa3a036f68d56a11db13.