Using org-image-actual-width
will both downscale and upscale. I just want to downscale big images to fit the current width. Any ideas?
Asked
Active
Viewed 853 times
4

HappyFace
- 751
- 4
- 16
1 Answers
0
The doc string for org-image-actual-width
says (among other things):
When set to nil, try to get the width from an #+ATTR.* keyword and fall back on the original width if none is found.
So set it to nil and specify the width with an #+ATTR
keyword only for the big images that you want to downscale. More info can be found in the manual in the Exporting
chapter, in section Images for HTML export and section Images in LaTeX export.

NickD
- 27,023
- 3
- 23
- 42
-
3This is not automatic downscaling. I'd need to automate adding an ATTR for each inserted image, and even then it would be hardcoded to my current screen resolution. – HappyFace Aug 18 '20 at 19:21
-
2I never said it was, but that's the best you can do I believe: Org mode has no idea what the size of an image you give it is - it will either insert it as is (no size spec) or it will set the size you tell it. – NickD Aug 18 '20 at 19:28
-
2There's no reason org-mode couldn't find out the image size and do something smart though; [org-mode uses](https://github.com/emacs-mirror/emacs/blob/5120b612f8520a855fc1819c3ebf86453c361e55/lisp/org/org.el#L16345..L16350) `create-image` which accepts a `:max-width` parameter in PROPS. Could be worth submitting a patch @HappyFace ;-) – unhammer Mar 15 '21 at 13:19
-
Any update on this? Should we submit an issue somewhere? – falematte Mar 16 '22 at 10:23