Function: image-save

image-save is an interactive and byte-compiled function defined in image.el.gz.

Signature

(image-save)

Documentation

Save the image under point.

This writes the original image data to a file. Rotating or changing the displayed image size does not affect the saved image.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/image.el.gz
(defun image-save ()
  "Save the image under point.
This writes the original image data to a file.  Rotating or
changing the displayed image size does not affect the saved image."
  (interactive)
  (let ((image (image--get-image)))
    (with-temp-buffer
      (let ((file (plist-get (cdr image) :file)))
        (if file
            (if (not (file-exists-p file))
                (error "File %s no longer exists" file)
              (insert-file-contents-literally file))
          (insert (plist-get (cdr image) :data))))
      (write-region (point-min) (point-max)
                    (read-file-name "Write image to file: ")))))