Function: treemacs--create-image

treemacs--create-image is a byte-compiled function defined in treemacs-icons.el.

Signature

(treemacs--create-image FILE-PATH)

Documentation

Load image from FILE-PATH and size it based on treemacs--icon-size.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-icons.el
(defun treemacs--create-image (file-path)
  "Load image from FILE-PATH and size it based on `treemacs--icon-size'."
  (let ((height treemacs--icon-size)
        (width treemacs--icon-size))
    (when (and (integerp treemacs--icon-size)
               (s-starts-with? "root-" file-path))
      (treemacs--root-icon-size-adjust width height))
    (if (and (integerp treemacs--icon-size) (image-type-available-p 'imagemagick))
        (create-image
         file-path 'imagemagick nil
         :ascent 'center
         :width width
         :height height
         :mask 'heuristic)
      (create-image
       file-path
       (intern (treemacs--file-extension (treemacs--filename file-path)))
       nil
       :ascent 'center
       :width width
       :height height
       :mask 'heuristic))))