From unknown Sat Jun 14 19:08:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#73617: [PATCH] Correctly update image properties Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Oct 2024 15:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73617 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 73617@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17279675412145 (code B ref -1); Thu, 03 Oct 2024 15:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Oct 2024 14:59:01 +0000 Received: from localhost ([127.0.0.1]:33717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swNID-0000YR-BE for submit@debbugs.gnu.org; Thu, 03 Oct 2024 10:59:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:34360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swNIB-0000YE-Ia for submit@debbugs.gnu.org; Thu, 03 Oct 2024 10:59:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swNI9-0007z8-0c for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 10:58:57 -0400 Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swNI6-0004By-T7 for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 10:58:56 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=4B/HkM2r CKZDKha87PxtLg2gCJLIakT1pmRRPAubTTk=; h=date:subject:to:from; d=ledu-giraud.fr; b=6NRN01hMP3B7xXj14U6Gk+UBkx01iS97IqgqwTTdZJCYrYkQMo A2l/WF9BO/apz1Wnj48TdEhLlRiK2fbCzOAw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=4B/HkM2rCKZDKha8 7PxtLg2gCJLIakT1pmRRPAubTTk=; h=date:subject:to:from; d=ledu-giraud.fr; b=zhB2Ccc5nv3JJdPF3BCgxv7ievM0Mqrylx+bPMztn/j+UxCzjR IObWMZQvcYm7tqABlZ+8Km4jg4LvoQOr9FNxG7WHyS79Z1yhA5dsfXIsKdBQsROTq6UYRZ rg166tx2+fARrzNEz0wfxbPq4cK9KfRoPTSaokiP9+DRpCN78zlaFKwMy+sm+/kuQEd8p+ falg+LrVcIjnh65AEdrOWI9DFKlTweqXdn5mMIw/F8Z4kvPuiswl+aQYnmFd5DZ2NDUsZE DwXYfgkyhyqC4caYb32veaJP0tt1EejpHQW5yJhoIE0JLbodgJKPLvivoHvlVi0C0vx7Du 4x8XbM12vttg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 4d3566bc (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Thu, 3 Oct 2024 16:58:50 +0200 (CEST) From: Manuel Giraud Date: Thu, 03 Oct 2024 16:58:49 +0200 Message-ID: <87o741qlli.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Hi, Here is a patch that fixes how image's properties are updated. You could reproduce this issue as follow: - emacs -Q - C-x C-f etc/images/kitchen-sink.xpm - s s 8 - s m none ;; -> the image is still smoothed With this patch, the smoothing is updated accordingly. In GNU Emacs 31.0.50 (build 9, x86_64-unknown-openbsd7.6, X toolkit) of 2024-10-02 built on computer Repository revision: 4bb62af3263057312021e076dc7e0c8ff195e38f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: OpenBSD computer 7.6 GENERIC.MP#344 amd64 Configured using: 'configure CC=egcc CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs --bindir=/home/manuel/bin --with-x-toolkit=lucid --with-toolkit-scroll-bars=no --without-cairo --without-compress-install' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Correctly-update-image-properties.patch >From b59964af3c646efa79749e8d072784741ce57ac0 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 3 Oct 2024 16:20:19 +0200 Subject: [PATCH] Correctly update image properties * lisp/image-mode.el (image--update-properties): New function to update image properties. (image-toggle-display-image): Use it. --- lisp/image-mode.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7cf7845e935..6ad4c382d5f 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -867,6 +867,16 @@ image--scale-within-limits-p (or (<= mw (* (car size) scale)) (<= mh (* (cdr size) scale)))))) +(defun image--update-properties (image properties) + "Update IMAGE with the new PROPERTIES set." + (let ((image-properties (cdr image)) + prop val) + (while (setq prop (car properties)) + (setq val (cadr properties) + properties (cddr properties)) + (plist-put image-properties prop val)) + (cons (car image) image-properties))) + (defun image-toggle-display-image () "Show the image of the image file. Turn the image data into a real image, but only if the whole file @@ -959,7 +969,7 @@ image-toggle-display-image ;; Discard any stale image data before looking it up again. (image-flush image) - (setq image (append image (image-transform-properties image))) + (setq image (image--update-properties image (image-transform-properties image))) (setq props `(display ,image ;; intangible ,image -- 2.46.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=-- From unknown Sat Jun 14 19:08:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#73617: [PATCH] Correctly update image properties Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Oct 2024 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73617 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 73617@debbugs.gnu.org X-Debbugs-Original-To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: 73617@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17280526145491 (code B ref -1); Fri, 04 Oct 2024 14:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Oct 2024 14:36:54 +0000 Received: from localhost ([127.0.0.1]:36185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swjQL-0001QV-LP for submit@debbugs.gnu.org; Fri, 04 Oct 2024 10:36:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:52444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swjQK-0001QO-75 for submit@debbugs.gnu.org; Fri, 04 Oct 2024 10:36:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swjQF-0000WM-Q1 for bug-gnu-emacs@gnu.org; Fri, 04 Oct 2024 10:36:47 -0400 Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swjQD-0005Pj-E4 for bug-gnu-emacs@gnu.org; Fri, 04 Oct 2024 10:36:47 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=ivn0IBnQ s5PFGWpwt8k9P4AvWntkxV4acudrmugzGsA=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=r6vgxfSO5w/SPNKfqWZbJdNMMjqYfy wXbAe0/DOvfxFdYPgzJjfWbNYRQAw3mSMKW9WheKdqpFKMt6VV/LRfBA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=ivn0IBnQs5PFGWpw t8k9P4AvWntkxV4acudrmugzGsA=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=XHxSCBRiLuahRL0wD1NiipBefedwIpjVkVZYZN siiIlZX/kxIVrD1boeO2dLZ7JM5xhdVCYOjeJEW1tMtdHp2UTUU9JAsHGQhI27jkHFc5jV udIQtZvGHrbL2O9/4pyVaexw9FK748AOs6ZxdoaU1DAVOfE6Dt+svkMwoAMidFgQG4X5ga TNpWi/PdnVFr1JDS4A13G0iwal7rw7fG8qVY23QCzpEKuCkbPMPYpSmQm/jftsbNMrogdo kXGUgTXms0epg/srs2oUlMLJ8W00K0utkM1drd0clHr20TNqGZRnDgT6vRbERBSRYtOhYQ tdilVi5gt6rHggcki4hgdbAg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 0e030351 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 4 Oct 2024 16:36:42 +0200 (CEST) From: Manuel Giraud In-Reply-To: <87o741qlli.fsf@ledu-giraud.fr> (Manuel Giraud via's message of "Thu, 03 Oct 2024 16:58:49 +0200") References: <87o741qlli.fsf@ledu-giraud.fr> Date: Fri, 04 Oct 2024 16:36:24 +0200 Message-ID: <87ttdsoryv.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hi, Same patch with a shorter version of image--update-properties. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Correctly-update-image-properties.patch >From 3ea82382dbd42d9e047c1c6c99cd7602b10c98f4 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 3 Oct 2024 16:20:19 +0200 Subject: [PATCH] Correctly update image properties * lisp/image-mode.el (image--update-properties): New function to update image properties. (image-toggle-display-image): Use it. --- lisp/image-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7cf7845e935..e75f6ea918f 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -867,6 +867,13 @@ image--scale-within-limits-p (or (<= mw (* (car size) scale)) (<= mh (* (cdr size) scale)))))) +(defun image--update-properties (image properties) + "Update IMAGE with the new PROPERTIES set." + (let (prop) + (while (setq prop (pop properties)) + (plist-put (cdr image) prop (pop properties))) + image)) + (defun image-toggle-display-image () "Show the image of the image file. Turn the image data into a real image, but only if the whole file @@ -959,7 +966,7 @@ image-toggle-display-image ;; Discard any stale image data before looking it up again. (image-flush image) - (setq image (append image (image-transform-properties image))) + (setq image (image--update-properties image (image-transform-properties image))) (setq props `(display ,image ;; intangible ,image -- 2.46.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=-- From unknown Sat Jun 14 19:08:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Manuel Giraud Subject: bug#73617: closed (Re: bug#73617: [PATCH] Correctly update image properties) Message-ID: References: <86y12two01.fsf@gnu.org> <87o741qlli.fsf@ledu-giraud.fr> X-Gnu-PR-Message: they-closed 73617 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 73617@debbugs.gnu.org Date: Sat, 12 Oct 2024 11:38:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1728733082-30842-1" This is a multi-part message in MIME format... ------------=_1728733082-30842-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #73617: [PATCH] Correctly update image properties which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 73617@debbugs.gnu.org. --=20 73617: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73617 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1728733082-30842-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 73617-done) by debbugs.gnu.org; 12 Oct 2024 11:37:59 +0000 Received: from localhost ([127.0.0.1]:39297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szaRa-00081B-Sl for submit@debbugs.gnu.org; Sat, 12 Oct 2024 07:37:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szaRY-00080v-6w for 73617-done@debbugs.gnu.org; Sat, 12 Oct 2024 07:37:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szaRE-0006ra-Tj; Sat, 12 Oct 2024 07:37:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IqnI533D1SKBhtL/XQTz6GUfP1IgICgPAqjWnYH2aoU=; b=Mc1o5rqPvrMl +xPI0uasQDfJuEDMMwAyQx+TjpJOXrWbKzecHJrnEnwAhIElBgrKpurSo+4X9SKM1bpILuhT3h5sX aiv/AtPjkWCjuo04TlngSYWpONh1qEr6fQQBd0SVtuTqgnWtRqKnnsZRKJ9WWvA2jbNnY6xHwxiEB fkqWhHssxGZrZBMFV2S1btxWp3CsjQOCPTBzNeleTL4M6mKC7k6bQNvifH637zBuB1m0c6sRPQnT1 2lOlkLkaQ2qqF6Jx8yMPsudgizZRPK6eIL6nS3VwmACs9EdnO8wvJgu5WxeL9RC4zfrCtQ2ScWZlH v4tODQ5Eb4FZRJICb1jnBw==; Date: Sat, 12 Oct 2024 14:37:34 +0300 Message-Id: <86y12two01.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87ttdsoryv.fsf@ledu-giraud.fr> (bug-gnu-emacs@gnu.org) Subject: Re: bug#73617: [PATCH] Correctly update image properties References: <87o741qlli.fsf@ledu-giraud.fr> <87ttdsoryv.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73617-done Cc: 73617-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 04 Oct 2024 16:36:24 +0200 > From: Manuel Giraud via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Same patch with a shorter version of image--update-properties. Thanks, installed on the master branch, and closing the bug. ------------=_1728733082-30842-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Oct 2024 14:59:01 +0000 Received: from localhost ([127.0.0.1]:33717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swNID-0000YR-BE for submit@debbugs.gnu.org; Thu, 03 Oct 2024 10:59:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:34360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swNIB-0000YE-Ia for submit@debbugs.gnu.org; Thu, 03 Oct 2024 10:59:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swNI9-0007z8-0c for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 10:58:57 -0400 Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swNI6-0004By-T7 for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 10:58:56 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=4B/HkM2r CKZDKha87PxtLg2gCJLIakT1pmRRPAubTTk=; h=date:subject:to:from; d=ledu-giraud.fr; b=6NRN01hMP3B7xXj14U6Gk+UBkx01iS97IqgqwTTdZJCYrYkQMo A2l/WF9BO/apz1Wnj48TdEhLlRiK2fbCzOAw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=4B/HkM2rCKZDKha8 7PxtLg2gCJLIakT1pmRRPAubTTk=; h=date:subject:to:from; d=ledu-giraud.fr; b=zhB2Ccc5nv3JJdPF3BCgxv7ievM0Mqrylx+bPMztn/j+UxCzjR IObWMZQvcYm7tqABlZ+8Km4jg4LvoQOr9FNxG7WHyS79Z1yhA5dsfXIsKdBQsROTq6UYRZ rg166tx2+fARrzNEz0wfxbPq4cK9KfRoPTSaokiP9+DRpCN78zlaFKwMy+sm+/kuQEd8p+ falg+LrVcIjnh65AEdrOWI9DFKlTweqXdn5mMIw/F8Z4kvPuiswl+aQYnmFd5DZ2NDUsZE DwXYfgkyhyqC4caYb32veaJP0tt1EejpHQW5yJhoIE0JLbodgJKPLvivoHvlVi0C0vx7Du 4x8XbM12vttg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 4d3566bc (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Thu, 3 Oct 2024 16:58:50 +0200 (CEST) From: Manuel Giraud To: bug-gnu-emacs@gnu.org Subject: [PATCH] Correctly update image properties X-Debbugs-Cc: Date: Thu, 03 Oct 2024 16:58:49 +0200 Message-ID: <87o741qlli.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Hi, Here is a patch that fixes how image's properties are updated. You could reproduce this issue as follow: - emacs -Q - C-x C-f etc/images/kitchen-sink.xpm - s s 8 - s m none ;; -> the image is still smoothed With this patch, the smoothing is updated accordingly. In GNU Emacs 31.0.50 (build 9, x86_64-unknown-openbsd7.6, X toolkit) of 2024-10-02 built on computer Repository revision: 4bb62af3263057312021e076dc7e0c8ff195e38f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: OpenBSD computer 7.6 GENERIC.MP#344 amd64 Configured using: 'configure CC=egcc CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs --bindir=/home/manuel/bin --with-x-toolkit=lucid --with-toolkit-scroll-bars=no --without-cairo --without-compress-install' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Correctly-update-image-properties.patch >From b59964af3c646efa79749e8d072784741ce57ac0 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 3 Oct 2024 16:20:19 +0200 Subject: [PATCH] Correctly update image properties * lisp/image-mode.el (image--update-properties): New function to update image properties. (image-toggle-display-image): Use it. --- lisp/image-mode.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7cf7845e935..6ad4c382d5f 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -867,6 +867,16 @@ image--scale-within-limits-p (or (<= mw (* (car size) scale)) (<= mh (* (cdr size) scale)))))) +(defun image--update-properties (image properties) + "Update IMAGE with the new PROPERTIES set." + (let ((image-properties (cdr image)) + prop val) + (while (setq prop (car properties)) + (setq val (cadr properties) + properties (cddr properties)) + (plist-put image-properties prop val)) + (cons (car image) image-properties))) + (defun image-toggle-display-image () "Show the image of the image file. Turn the image data into a real image, but only if the whole file @@ -959,7 +969,7 @@ image-toggle-display-image ;; Discard any stale image data before looking it up again. (image-flush image) - (setq image (append image (image-transform-properties image))) + (setq image (image--update-properties image (image-transform-properties image))) (setq props `(display ,image ;; intangible ,image -- 2.46.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=-- ------------=_1728733082-30842-1--