From: Alan Third <alan@idiocy.org>
To: David Ponce <da_vid@orange.fr>
Cc: 47819@debbugs.gnu.org
Subject: bug#47819: 8.0.50; When :height/:width image attribute is specified, :scale factor is not applied
Date: Fri, 16 Apr 2021 19:14:50 +0100 [thread overview]
Message-ID: <YHnUGvPYfGsyIBdn@breton.holly.idiocy.org> (raw)
In-Reply-To: <bdae3dec-c36b-4398-f3c9-e3155a587edc@orange.fr>
[-- Attachment #1: Type: text/plain, Size: 610 bytes --]
On Fri, Apr 16, 2021 at 08:16:20AM +0200, David Ponce wrote:
> Hello,
>
> For the image :scale attribute the Elisp reference manual say that:
>
> If both ‘:scale’ and ‘:height’/‘:width’ are
> specified, the height/width will be adjusted by the specified
> scaling factor.
>
> It seems, however, that this is not true, when the :height or :width
> or both attributes of an image are specified, the :scale factor is not
> applied.
Hmm, I'm not sure which is the more desirable behaviour, but fixing it
to match the documentation appears to be trivial. See attached.
--
Alan Third
[-- Attachment #2: 0001-Make-scale-affect-width-and-height-bug-47819.patch --]
[-- Type: text/plain, Size: 1096 bytes --]
From 6ffcd0d934e028732484ac1f9085901d1515036a Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Fri, 16 Apr 2021 19:12:23 +0100
Subject: [PATCH] Make :scale affect :width and :height (bug#47819)
* src/image.c (compute_image_size): Multiply width and height values
by scale.
---
src/image.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/image.c b/src/image.c
index 1619886f5a..ff4ef01804 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2040,7 +2040,7 @@ compute_image_size (size_t width, size_t height,
int_value = image_get_dimension (img, QCwidth);
if (int_value >= 0)
{
- desired_width = int_value;
+ desired_width = int_value * scale;
/* :width overrides :max-width. */
max_width = -1;
}
@@ -2048,7 +2048,7 @@ compute_image_size (size_t width, size_t height,
int_value = image_get_dimension (img, QCheight);
if (int_value >= 0)
{
- desired_height = int_value;
+ desired_height = int_value * scale;
/* :height overrides :max-height. */
max_height = -1;
}
--
2.29.2
next prev parent reply other threads:[~2021-04-16 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 6:16 bug#47819: 8.0.50; When :height/:width image attribute is specified, :scale factor is not applied David Ponce
2021-04-16 18:14 ` Alan Third [this message]
2021-04-16 18:50 ` David Ponce
2021-04-17 8:23 ` Alan Third
2021-04-17 8:42 ` Alan Third
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YHnUGvPYfGsyIBdn@breton.holly.idiocy.org \
--to=alan@idiocy.org \
--cc=47819@debbugs.gnu.org \
--cc=da_vid@orange.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).