emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Prevent displayed images from being re-scaled


From: Timothy
Subject: [PATCH] Prevent displayed images from being re-scaled
Date: Wed, 29 Sep 2021 21:33:34 +0800
User-agent: mu4e 1.6.5; emacs 28.0.50

Hello,

After my last patch providing support for proportional image width attributes
(e.g. 70% of the text width), I noticed that the results looked slightly off.
Investigating the code lead me to `create-image' which takes the liberty of
re-scaling images based on your default font size. As you might imagine, this
can be problematic when if you say determine that image should be 70% of the
text width, the text width is 1000px, and so the image should be 700px wide —
but upon being told to make the image 700 pixels wide `create-image' decides to
make it say 850 pixels wide. I personally found that images >~80% wide were
being made wider than the buffer, which isn’t good.

To make image width behave as expected, we can just specify `:scale 1' when
calling `create-image', and that will stop it from re-interpreting the `:width'
specification. See the patch attached.

All the best,
Timothy

Attachment: 0001-org-Don-t-change-image-size-based-on-font-size.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]