Function: image-transform-set-percent

image-transform-set-percent is an interactive and byte-compiled function defined in image-mode.el.gz.

Signature

(image-transform-set-percent SCALE)

Documentation

Prompt for a percentage, and resize the current image to that size.

The percentage is in relation to the original size of the image.

View in manual

Probably introduced at or before Emacs version 29.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/image-mode.el.gz
(defun image-transform-set-percent (scale)
  "Prompt for a percentage, and resize the current image to that size.
The percentage is in relation to the original size of the image."
  (interactive (list (read-number "Scale (% of original): " 100
                                  'read-number-history))
               image-mode)
  (unless (plusp scale)
    (error "Not a positive number: %s" scale))
  (setq image-transform-resize (/ scale 100.0))
  (image-toggle-display-image))