octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46084] image package: imcrop() doesn't work a


From: Avinoam Kalma
Subject: [Octave-bug-tracker] [bug #46084] image package: imcrop() doesn't work any more
Date: Sun, 04 Oct 2015 06:28:33 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36

Follow-up Comment #4, bug #46084 (project octave):

Regarding comment#3, 2nd remark, the following patch should do the work:


diff -r f642c5c47ba7 inst/imcrop.m
--- a/inst/imcrop.m     Wed Aug 19 11:19:03 2015 +0300
+++ b/inst/imcrop.m     Sun Oct 04 09:25:11 2015 +0300
@@ -162,6 +162,16 @@
   ## Finally, crop the image
   if (interactive)
     [x, y] = ginput (2);
+    if (x(2) < x(1))
+      tmp = x(1);
+      x(1) = x(2);
+      x(2) = tmp;
+    endif
+    if (y(2) < y(1))
+      tmp = y(1);
+      y(1) = y(2);
+      y(2) = tmp;
+    endif
     rect = [x(1) y(1) x(2)-x(1) y(2)-y(1)];
   endif
   i_ini = round ([rect(1) rect(2)]);



 

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46084>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]