diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2016-08-24 00:31:57 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2016-08-24 00:31:57 +0200 |
commit | 8d73c252be365868c8d7b98015ea968ead167da4 (patch) | |
tree | 42a52d4f9cca84ca09871f0ac85d5300f281f344 /lisp/image.el | |
parent | f345fdd7e64064194a9235406971f62b9da09ae2 (diff) | |
download | emacs-8d73c252be365868c8d7b98015ea968ead167da4.tar.gz |
Fix invalid image rotations
* lisp/image.el (image-rotate): Limit rotation to 360 degrees.
Diffstat (limited to 'lisp/image.el')
-rw-r--r-- | lisp/image.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/image.el b/lisp/image.el index 08df7d4aa1a..272cee53e4f 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." |