Function: image-dired--get-create-thumbnail-file

image-dired--get-create-thumbnail-file is a byte-compiled function defined in image-dired.el.gz.

Signature

(image-dired--get-create-thumbnail-file FILE)

Documentation

Return the image descriptor for a thumbnail of image file FILE.

Aliases

image-dired-get-thumbnail-image (obsolete since 29.1)

Source Code

;; Defined in /usr/src/emacs/lisp/image/image-dired.el.gz
(defun image-dired--get-create-thumbnail-file (file)
  "Return the image descriptor for a thumbnail of image file FILE."
  (unless (string-match-p (image-dired--file-name-regexp) file)
    (error "%s is not a valid image file" file))
  (let* ((thumb-file (image-dired-thumb-name file))
         (thumb-attr (file-attributes thumb-file)))
    (if (or (not thumb-attr)
            (time-less-p (file-attribute-modification-time thumb-attr)
                         (file-attribute-modification-time
                          (file-attributes file))))
        (image-dired-create-thumb file thumb-file)
      (image-dired-debug "Found thumb for %s: %s"
                         (file-name-nondirectory file)
                         (file-name-nondirectory thumb-file)))
    thumb-file))