Rawtherapee: Preview updates incorrectly when using perspective correction

Created on 21 Jun 2020  路  3Comments  路  Source: Beep6581/RawTherapee

This is a follow-up to a bug @heckflosse found. https://github.com/Beep6581/RawTherapee/pull/5569#issuecomment-646619991

Example:

  1. Open an image. Apply the neutral profile.
  2. Set horizontal perspective to +100.
  3. Change the value to -100 by typing it in. The value must change from +100 to -100 directly, so don't use the slider.
  4. Observe how the preview is shifted to the right compared to the navigator.
    image

I believe the problem is due to the crop image (origCrop) not being updated if the width and height do not change. The following patch fixes the bug by triggering an update if the crop's x or y value changes, but I'm not sure if it is a proper solution.

diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc
index 99bc2581d..ba1884c93 100644
--- a/rtengine/dcrop.cc
+++ b/rtengine/dcrop.cc
@@ -1780,8 +1780,11 @@ bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool inter
     int orW, orH;
     parent->imgsrc->getSize(cp, orW, orH);

-    trafx = orx;
-    trafy = ory;
+    if (trafx != orx || trafy != ory) {
+        trafx = orx;
+        trafy = ory;
+        changed = true;
+    }

     int cw = skips(bw, skip);
     int ch = skips(bh, skip);
bug

Most helpful comment

Hey @Lawrence37

The team appreciates your involvement and thought it would be good to give you commit access, so if you accept the invitation you will have it immediately. Great power, great responsibility, and all that.
See this, and shoot if you have questions:
https://github.com/Beep6581/RawTherapee/blob/dev/CONTRIBUTING.md

All 3 comments

Hey @Lawrence37

The team appreciates your involvement and thought it would be good to give you commit access, so if you accept the invitation you will have it immediately. Great power, great responsibility, and all that.
See this, and shoot if you have questions:
https://github.com/Beep6581/RawTherapee/blob/dev/CONTRIBUTING.md

Thanks! I've been a long time user of RawTherapee and this is my way of giving back. I'll try not to break things.

I do have a question. What are some guidelines for requesting reviews in pull requests? I don't want to spam people with unnecessary requests.

@Lawrence37 Welcome to the team :+1:

What are some guidelines for requesting reviews in pull requests?

Just request a review from me. I will then look and perhaps request a review from someone else too

Was this page helpful?
0 / 5 - 0 ratings