>> @@ -2178,23 +2178,39 @@ (defun org-link-preview-file (ov path link)
>>  
>>  This is intended to be used as the `:preview' link property of
>>  file links, see `org-link-parameters'."
>> -  (when (display-graphic-p)
>> -    (require 'image)
>>      (when-let* ((file-full (expand-file-name path))
>>                  (file (substitute-in-file-name file-full))
>>                  ((string-match-p (image-file-name-regexp) file))
>>                  ((file-exists-p file)))
>> -      (let* ((width (org-display-inline-image--width link))
>> -         (align (org-image--align link))
>> -             (image (org--create-inline-image file width)))
>> -        (when image            ; Add image to overlay
>> -      ;; See bug#59902.  We cannot rely
>> +      (org-link-preview-image-data ov file link)))
>> +
>> +(defun org-link-preview-image-data (ov image-data &optional link align 
>> width)
>> +  "Display raw image data IMAGE-DATA in overlay OV for LINK.
>> ...
>
> I am looking at this and wonder why not simply change the whole
> org-link-preview file to have (ov image-data-or-path &optional link align 
> width)
> arguments. Then, we can make `org-link-preview-image-data' internal and
> only expose `org-link-preview-file' as the API function.

Ihor, what's the status of this patch?  Does it need more work?

Karthik

Reply via email to