From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Ponce via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74725: 31.0.50; image-scaling-factor is ignored by create-image Date: Sat, 7 Dec 2024 13:13:58 +0100 Message-ID: <2304cad6-884f-4528-a85e-ab9c06b80016@orange.fr> Reply-To: David Ponce Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29082"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 74725@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 07 13:15:20 2024 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 1tJtiS-0007Rg-BC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Dec 2024 13:15:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJtiC-0001hz-Fk; Sat, 07 Dec 2024 07:15:04 -0500 Original-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 1tJtiB-0001hk-64 for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 07:15:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJtiA-0008Fc-Le for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 07:15:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:MIME-Version:Date:To:Subject; bh=mMGZYJ4e0Jo+KExxqmgyXNnw2l408XFRVIabrWGhPso=; b=homKw0MxuNhqp8ph0j1zlDVQ83xcfmVDCBQqSYhm/dSJ5LRFj6WYwINApH7Tsf/U9Xylw7jlMqIdfzpPs3EsYF4yfVL9GsM6qU7QnBiqDy87K2g80hvUHVCbU2by++J9fV8Id077gvKkqoTovtOT0kXLJdmCEcZ2loGGhT8TwSJoRxVGEdZ9rUZmWRRKl3eNsbUoYLYPanAYpOrM1WnQALMkymyAkDfDIZ4qzQ295193q24IsN8vK/jT82vRf4dGyRsNak762UEuv3xm9spc9pOctj8CBM9NZu4o/SMnydaWB399TBatwav+/dkIBEy0eTq7JOtoQOs8lyBqWj2gXw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tJtiA-0001Bs-Gh for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 07:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David Ponce Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Dec 2024 12:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74725 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17335736534480 (code B ref -1); Sat, 07 Dec 2024 12:15:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Dec 2024 12:14:13 +0000 Original-Received: from localhost ([127.0.0.1]:45659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJthM-0001AB-T6 for submit@debbugs.gnu.org; Sat, 07 Dec 2024 07:14:13 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJthI-0001A2-Tc for submit@debbugs.gnu.org; Sat, 07 Dec 2024 07:14:10 -0500 Original-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 1tJthI-0001YE-MK for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 07:14:08 -0500 Original-Received: from smtp-25.smtpout.orange.fr ([80.12.242.25] helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJthF-0008BF-KH for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 07:14:08 -0500 Original-Received: from [192.168.1.21] ([90.112.40.65]) by smtp.orange.fr with ESMTPA id Jth9tn99801M2Jth9tHXWp; Sat, 07 Dec 2024 13:14:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1733573640; bh=mMGZYJ4e0Jo+KExxqmgyXNnw2l408XFRVIabrWGhPso=; h=Message-ID:Date:MIME-Version:To:From:Subject; b=GwdzY3b+a2YQNnUtn8MflWH7yz5gMzW/6k3Duvp5RFsFU1QL6FP1RdpqyMZNJIGaC uPTGqOjffGZv1MsXq+7++LZmRVIOE2VcGdFu9Wpv9qIeo73Bn0QRZAmThHVmP+aKDk 7Hv3Sxil+ojj5YYcQXCqYo0ysqm9Jktv3FmEpXGrHj+czbyQY4Gk/YqHDXgE94MdC3 ZBBHwBVd2hm868hnpGkQjR0+kE3gMv2lq8ikHuPYxaJC5cqWq+ruyEeQgsp0ietmjd FfsPoq5lglzThNb99+/PrG4kzed/F3am0t9JpBis/QT1nVLHH8MNS7LvKSDrghCCBJ vrDUe7AVdxi3A== X-ME-Helo: [192.168.1.21] X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI= X-ME-Date: Sat, 07 Dec 2024 13:14:00 +0100 X-ME-IP: 90.112.40.65 Content-Language: fr, en-US Received-SPF: pass client-ip=80.12.242.25; envelope-from=da_vid@orange.fr; helo=smtp.smtpout.orange.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296544 Archived-At: Hello, While working with images, I found what seems an issue to me with `create-image' which unconditionally set the :scale image property to 'default' when not specified, ignoring the value of the option `image-scaling-factor'. Here is an illustration: (let ((image-scaling-factor 1.0)) (image-size (find-image '((:file "icons/hicolor/scalable/apps/emacs.svg"))) t)) => (63 . 63) (let ((image-scaling-factor 2.0)) (image-size (find-image '((:file "icons/hicolor/scalable/apps/emacs.svg"))) t)) => (63 . 63) (image-size (find-image '((:file "icons/hicolor/scalable/apps/emacs.svg" :scale 1))) t) => (48 . 48) (image-size (find-image '((:file "icons/hicolor/scalable/apps/emacs.svg" :scale 2))) t) => (96 . 96) You can replace `image-size' with `insert-image' and observe the same. Here is a simple patch which fix the issue for me: diff --git a/lisp/image.el b/lisp/image.el index ce97eeb3ca1..2c1e865c336 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -536,7 +536,9 @@ create-image file-or-data) (and (not (plist-get props :scale)) ;; Add default scaling. - (list :scale 'default)) + (list :scale (if (numberp image-scaling-factor) + image-scaling-factor + 'default))) props))) ;; Add default smoothing. (unless (plist-member props :transform-smoothing) Thanks! In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.0) of 2024-12-02 Repository revision: 8cd4ab7abde87ac04e05442196b4646ab46df9a7 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 40 (KDE Plasma) Configured using: 'configure --with-native-compilation=no PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LC_TIME: fr_FR.utf8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix