Function: image-dired-insert-thumbnail

image-dired-insert-thumbnail is a byte-compiled function defined in image-dired.el.gz.

Signature

(image-dired-insert-thumbnail FILE ORIGINAL-FILE-NAME ASSOCIATED-DIRED-BUFFER)

Documentation

Insert thumbnail image FILE.

Add text properties ORIGINAL-FILE-NAME, ASSOCIATED-DIRED-BUFFER.

Source Code

;; Defined in /usr/src/emacs/lisp/image/image-dired.el.gz
(defun image-dired-insert-thumbnail (file original-file-name
                                          associated-dired-buffer)
  "Insert thumbnail image FILE.
Add text properties ORIGINAL-FILE-NAME, ASSOCIATED-DIRED-BUFFER."
  (let (beg end)
    (setq beg (point))
    (image-dired-insert-image
     file
     ;; Thumbnails are created asynchronously, so we might not yet
     ;; have a file.  But if it exists, it might have been cached from
     ;; before and we should use it instead of our current settings.
     (or (and (file-exists-p file)
              (image-type-from-file-header file))
         (and (memq image-dired-thumbnail-storage
                    image-dired--thumbnail-standard-sizes)
              'png)
         'jpeg)
     image-dired-thumb-relief
     image-dired-thumb-margin)
    (setq end (point))
    (add-text-properties
     beg end
     (list 'image-dired-thumbnail t
           ;; Disable `image-map' on thumbnails.
           'keymap nil
           'original-file-name original-file-name
           'associated-dired-buffer associated-dired-buffer
           'tags (image-dired-list-tags original-file-name)
           'mouse-face 'highlight
           'comment (image-dired-get-comment original-file-name)))))