emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 8d73c25: Fix invalid image rotations


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 8d73c25: Fix invalid image rotations
Date: Tue, 23 Aug 2016 22:32:59 +0000 (UTC)

branch: master
commit 8d73c252be365868c8d7b98015ea968ead167da4
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix invalid image rotations
    
    * lisp/image.el (image-rotate): Limit rotation to 360 degrees.
---
 lisp/image.el |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/image.el b/lisp/image.el
index 08df7d4..272cee5 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -1013,7 +1013,11 @@ default is 20%."
   (interactive)
   (let ((image (image--get-imagemagick-and-warn)))
     (plist-put (cdr image) :rotation
-               (float (+ (or (plist-get (cdr image) :rotation) 0) 90)))))
+               (float (mod (+ (or (plist-get (cdr image) :rotation) 0) 90)
+                           ;; We don't want to exceed 360 degrees
+                           ;; rotation, because it's not seen as valid
+                           ;; in exif data.
+                           360)))))
 
 (defun image-save ()
   "Save the image under point."



reply via email to

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