Function: eca-chat--image-thumbnail

eca-chat--image-thumbnail is a natively compiled function defined in eca-chat-image.el.

Signature

(eca-chat--image-thumbnail PATH)

Documentation

Return a thumbnail image of the file at PATH, or nil.

Return nil when Emacs can't decode it. Remote files are read through their file handler, which image loading bypasses.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat-image.el
(defun eca-chat--image-thumbnail (path)
  "Return a thumbnail image of the file at PATH, or nil.
Return nil when Emacs can't decode it.  Remote files are read
through their file handler, which image loading bypasses."
  (let ((props (list :max-width eca-chat-image-thumbnail-size
                     :max-height eca-chat-image-thumbnail-size
                     :ascent 'center)))
    (ignore-errors
      (if (file-remote-p path)
          (apply #'create-image
                 (with-temp-buffer
                   (set-buffer-multibyte nil)
                   (insert-file-contents-literally path)
                   (buffer-string))
                 nil t props)
        (apply #'create-image path nil nil props)))))