2

I'm only interested in restraining the image size directly inside the org file and not for exportation. When the image is outside of a table it's easy to render it reduced with:

#+ATTR_ORG: :width 100
[[./path/to/file.jpg]]

But how can I do this if the image is inside a table? Is it even possible?

Nicryc
  • 147
  • 4
  • If I understand correctly, you are looking for a solution that resizes _visually_ in the Org _buffer_ an image inside an Org table ? I'd say that it's possible by writing a hook function which resizes such images depending on the frame width. – Firmin Martin Aug 07 '21 at 21:13
  • @FirminMartin Yes absolutely. – Nicryc Aug 07 '21 at 23:05
  • Does the variable `org-image-actual-width` help? Set it to a number (of pixels) to restrict the width of *all* images to that width. Far from ideal, but it might help in your particular situation. – NickD Aug 08 '21 at 00:04
  • By looking at the source code where `org-image-actual-width` is involved, the key of my idea above is the variable `org-inline-image-overlays`. It provides an overlay list of all images visually displayed in the Org buffer. Then, using `org-at-table-p` and `overlay-start`, one can find out which images are in an Org table. The `'display` property of the overlays provides information of the image. So, one should be able to recreate the image with a different `:width` computed to fit the Org buffer and finally put the overlay. Will see if I can write an answer. No guarantee. – Firmin Martin Aug 08 '21 at 00:53
  • The tricky part arises when several images are present in different columns of the Org table. – Firmin Martin Aug 08 '21 at 00:58

0 Answers0