Project

General

Profile

Bug #10025

Garbage is displayed when zoom > 100% and flip != no

Added by Roman Lebedev almost 5 years ago. Updated almost 5 years ago.

Status:
Fixed
Priority:
High
Assignee:
Category:
Darkroom
Start date:
07/27/2014
Due date:
% Done:

100%

Affected Version:
git development version
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

This is not recent regression, i was able to reproduce this on 1.4.2 too.

OpenCL: does not matter.
Other modules: does not matter.

Steps to reproduce:
1. Open image.
2. Zoom in (>100%, for me 125-200%)
3. Change image orientation (must be not "no rotation")
4. Move zoomed-in view (On some (reproducible) image places, correct image is displayed, on some - garbage)
5. Change zoom level
6. If image is still not garbled, repeat steps 3-6

I believe this is found only now because of PR584, although i suspect it was there from the beginning.
Because of this it should preferably be fixed before 1.6 release.

git-bisect-log (2.19 KB) Roman Lebedev, 08/01/2014 11:30 AM

zoom_scale.patch Magnifier (984 Bytes) Dan Torop, 08/08/2014 02:52 AM

History

#1 Updated by Roman Lebedev almost 5 years ago

  • Priority changed from Medium to High

On X-Trans images, Markestijn 3pass crashes because of this.

#2 Updated by Roman Lebedev almost 5 years ago

Attempted to `git bisect` it.

#3 Updated by Roman Lebedev almost 5 years ago

  • Status changed from New to Confirmed
  • % Done changed from 0 to 10

#4 Updated by Roman Lebedev almost 5 years ago

Zooming with middle click does not show this issue, only zooming with either ctrl+scrollwheel or with "zoom percentage indicator".

#5 Updated by Roman Lebedev almost 5 years ago

AddressSanitizer: heap-buffer-overflow on address ... in amaze_demosaic_RT._omp_fn.10 /home/lebedevri/darktable/src/iop/amaze_demosaic_RT.cc:523
AddressSanitizer: heap-buffer-overflow on address ... in vng_interpolate /home/lebedevri/darktable/src/iop/demosaic.c:1169
AddressSanitizer: heap-buffer-overflow on address ... in amaze_demosaic_RT._omp_fn.10 /home/lebedevri/darktable/src/iop/amaze_demosaic_RT.cc:567
AddressSanitizer: heap-buffer-overflow on address ... in amaze_demosaic_RT._omp_fn.10 /home/lebedevri/darktable/src/iop/amaze_demosaic_RT.cc:557
AddressSanitizer: heap-buffer-overflow on address ... in vng_interpolate /home/lebedevri/darktable/src/iop/demosaic.c:1175

#6 Updated by Roman Lebedev almost 5 years ago

After a discussion with dtorop on IRC, we believe:
  1. roi_in & roi_out arrive in VNG with a height of 0 just before the crash
  2. VNG4 always assumes height >= 4, thus it always crashes.
  3. PPG, it is basically a nop if height 0, hence it won't crash.
  4. Likewise Markesteijn is a nop if height 0, won't crash.
  5. VNG/Amaze can be patched to exit gracefully if height==0, but that'd just obscure the real issue... [unless solution is found before 1.6 this should probably be done (or disable zoom >100% :) )]

This means that the issue is in the core.

#7 Updated by Dan Torop almost 5 years ago

It looks like modify_roi_in() in flip is producing the height of 0. Still looking into this.

#8 Updated by Dan Torop almost 5 years ago

  • File zoom_scale.patchMagnifier added
  • % Done changed from 10 to 70
  • Status changed from Confirmed to Patch attached

There's a try at a fix in https://github.com/dtorop/darktable/tree/zoom-crash-garbage or in attached patch. Still need to think about this more, though.

This seems to fix the garbage/crash in portrait images at zooms of just less than 200%. There's still another problem, that garbage gets displayed at 200% near the right side of the image.

#9 Updated by Dan Torop almost 5 years ago

I made a PR for this patch, but am not totally happy about it. If someone can do better or have more sense of what's right, that is great.

The noise at the right side when viewing at 200% is still a problem. This seems to happen because flip's modify_roi_in() sees the scale as 1x, and hence its width/height values are not useful.

#10 Updated by Roman Lebedev almost 5 years ago

  • % Done changed from 70 to 100
  • Status changed from Patch attached to Fixed
  • Assignee set to Roman Lebedev

Should be fixed by PR643

Also available in: Atom PDF