Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.86k stars 321 forks source link

Bug in evaluating Catmull-Rom curves with straight segments at 0 or 1 #5072

Closed agriggio closed 5 years ago

agriggio commented 5 years ago

See here for examples of the weird behaviour:

https://discuss.pixls.us/t/5-5-rc1-curve-behaviour/10165

Here's a patch (to be applied after #5068 gets merged)

diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc
--- a/rtengine/diagonalcurves.cc
+++ b/rtengine/diagonalcurves.cc
@@ -326,6 +326,9 @@
     if (p1_y == p2_y && (p1_y == 0 || p1_y == 1)) {
         for (i = 1; i < n_points-1; ++i) {
             t = p1_x + space * i;
+            if (t >= p2_x) {
+                break;
+            }
             res_x.push_back(t);
             res_y.push_back(p1_y);
         }
heckflosse commented 5 years ago

@agriggio I edited your post (the link was wrong)

heckflosse commented 5 years ago

Fix confirmed.

agriggio commented 5 years ago

can I merge (in releases)?

Beep6581 commented 5 years ago

Please merge to dev