<div dir="ltr"><div>I don't think so, my package org-link-beautify ported to the new<br>:preview mechanism. The file preview not always image. Could be text, or<br>icon etc. So pass in image object is not a good idea. It will limit<br>preview functionality extensibility.</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">[stardiviner] <Hack this world!> GPG key ID: 47C32433<br>IRC(freeenode): stardiviner Twitter: @numbchild<br>Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433<br>Blog: <a href="http://stardiviner.github.io/" target="_blank">http://stardiviner.github.io/</a><br></div></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Dec 17, 2024 at 11:43 AM Karthik Chikmagalur <<a href="mailto:karthikchikmagalur@gmail.com">karthikchikmagalur@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>> Would it be possible to also handle image data in the function or<br> >> refactor the org-link-preview-file function in a way that the geometry<br> >> handling is done in a helper function which can be reused by other<br> >> handlers.<br> ><br> > There is such function: `org-display-inline-image--width'.<br> > We may consider exposing it as public function.<br> <br> This will not be enough, we will also have to expose `org-image--align'<br> and the alignment code:<br> <br> (when align<br> (overlay-put<br> ov 'before-string<br> (propertize<br> " " 'face 'default<br> 'display<br> (pcase align<br> ("center" `(space :align-to (- center (0.5 . ,image))))<br> ("right" `(space :align-to (- right ,image)))))))<br> <br> I don't think we can expect third party packages to figure out and<br> reimplement Org's image alignment logic.<br> <br> Considering this, it might be better to just split<br> `org-link-preview-file' into two public functions, where the "inside"<br> function accepts an image instead of a file.<br> <br> Karthik<br> <br> </blockquote></div>