Function: image-rotate
image-rotate is an interactive and byte-compiled function defined in
image.el.gz.
Signature
(image-rotate &optional ANGLE)
Documentation
Rotate the image under point by ANGLE degrees clockwise.
If nil, ANGLE defaults to 90. Interactively, rotate the image 90 degrees clockwise with no prefix argument, and counter-clockwise with a prefix argument. Note that most image types support rotations by only multiples of 90 degrees.
Probably introduced at or before Emacs version 27.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/image.el.gz
(defun image-rotate (&optional angle)
"Rotate the image under point by ANGLE degrees clockwise.
If nil, ANGLE defaults to 90. Interactively, rotate the image 90
degrees clockwise with no prefix argument, and counter-clockwise
with a prefix argument. Note that most image types support
rotations by only multiples of 90 degrees."
(interactive (and current-prefix-arg '(-90)))
(let ((image (image--get-imagemagick-and-warn)))
(setf (image-property image :rotation)
(float (mod (+ (or (image-property image :rotation) 0)
(or angle 90))
;; We don't want to exceed 360 degrees rotation,
;; because it's not seen as valid in Exif data.
360)))))