diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/image.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/image.el b/lisp/image.el index b58b1dc9542..c3e28655c38 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -1028,16 +1028,20 @@ default is 20%." | |||
| 1028 | (display-width (car (image-size image t)))) | 1028 | (display-width (car (image-size image t)))) |
| 1029 | (/ (float display-width) image-width))) | 1029 | (/ (float display-width) image-width))) |
| 1030 | 1030 | ||
| 1031 | (defun image-rotate () | 1031 | (defun image-rotate (&optional angle) |
| 1032 | "Rotate the image under point by 90 degrees clockwise." | 1032 | "Rotate the image under point by ANGLE degrees clockwise. |
| 1033 | (interactive) | 1033 | If nil, ANGLE defaults to 90. Interactively, rotate the image 90 |
| 1034 | degrees clockwise with no prefix argument, and counter-clockwise | ||
| 1035 | with a prefix argument. Note that most image types support | ||
| 1036 | rotations by only multiples of 90 degrees." | ||
| 1037 | (interactive (and current-prefix-arg '(-90))) | ||
| 1034 | (let ((image (image--get-imagemagick-and-warn))) | 1038 | (let ((image (image--get-imagemagick-and-warn))) |
| 1035 | (plist-put (cdr image) :rotation | 1039 | (setf (image-property image :rotation) |
| 1036 | (float (mod (+ (or (plist-get (cdr image) :rotation) 0) 90) | 1040 | (float (mod (+ (or (image-property image :rotation) 0) |
| 1037 | ;; We don't want to exceed 360 degrees | 1041 | (or angle 90)) |
| 1038 | ;; rotation, because it's not seen as valid | 1042 | ;; We don't want to exceed 360 degrees rotation, |
| 1039 | ;; in exif data. | 1043 | ;; because it's not seen as valid in Exif data. |
| 1040 | 360))))) | 1044 | 360))))) |
| 1041 | 1045 | ||
| 1042 | (defun image-save () | 1046 | (defun image-save () |
| 1043 | "Save the image under point." | 1047 | "Save the image under point." |