From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zk5sGOVNoADNwvlx" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33416"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47819@debbugs.gnu.org To: David Ponce Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 16 20:17:07 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXT1e-0008X0-P4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Apr 2021 20:17:07 +0200 Original-Received: from localhost ([::1]:60144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXT1d-0002e8-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Apr 2021 14:17:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXT0c-0002cP-J2 for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2021 14:16:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXT0c-0003BM-6P for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2021 14:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lXT0c-0004hf-2e for bug-gnu-emacs@gnu.org; Fri, 16 Apr 2021 14:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Apr 2021 18:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47819 X-GNU-PR-Package: emacs Original-Received: via spool by 47819-submit@debbugs.gnu.org id=B47819.161859690417980 (code B ref 47819); Fri, 16 Apr 2021 18:16:02 +0000 Original-Received: (at 47819) by debbugs.gnu.org; 16 Apr 2021 18:15:04 +0000 Original-Received: from localhost ([127.0.0.1]:41647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXSzg-0004fv-5r for submit@debbugs.gnu.org; Fri, 16 Apr 2021 14:15:04 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:44593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXSzd-0004ey-Mi for 47819@debbugs.gnu.org; Fri, 16 Apr 2021 14:15:02 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 6B70460191; Fri, 16 Apr 2021 18:14:55 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1618596894; bh=l0utD0ad0hDdBbXM/KHY6drv1+hvNaEEH4TI8n+Y3xc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C4A+5KOAjn8L3DndSxxAu6tIv9qX77KEiFu6rbPq2vkiI2lz7PvMScK6KkKJ0ODXS /Q7+NQmJD5zVDcnnbJEAedUV9f0QeGUvMgKe6YJQmm+3x0oAPm4kTqMQ2dnJvmIu+0 1iLJQHtCvEiMPk6ylQDTGM0u/PEZaCRZle7PHemkjB60aohuIbEuGuJv/IDGrUGgvm /kspfjouL3OpidmVhRJ+k0La4+xV+0bbBfKwJePo4nj6pCd4U1nPMOaxI8w+Q3Ahtk boDLDjDDLGgEKaRrL6l6b9ohZ6653seEymj/eVYx068sv/kRpG+3O5EBvQKEZdNIuB p53vgH1o/Gg5g== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 19C30202BD072E; Fri, 16 Apr 2021 19:14:50 +0100 (BST) Mail-Followup-To: Alan Third , David Ponce , 47819@debbugs.gnu.org Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204155 Archived-At: --zk5sGOVNoADNwvlx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 --zk5sGOVNoADNwvlx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Make-scale-affect-width-and-height-bug-47819.patch" >From 6ffcd0d934e028732484ac1f9085901d1515036a Mon Sep 17 00:00:00 2001 From: Alan Third 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 --zk5sGOVNoADNwvlx--