From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jan 2019 17:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33990@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154670918212536 (code B ref -1); Sat, 05 Jan 2019 17:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jan 2019 17:26:22 +0000 Received: from localhost ([127.0.0.1]:48037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfpiG-0003G7-To for submit@debbugs.gnu.org; Sat, 05 Jan 2019 12:26:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfpiE-0003Fy-JZ for submit@debbugs.gnu.org; Sat, 05 Jan 2019 12:26:19 -0500 Received: from [209.51.188.17] (port=54730 helo=lists.gnu.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfpiD-0003Wg-J4 for submit@debbugs.gnu.org; Sat, 05 Jan 2019 12:26:18 -0500 Received: from eggsout.gnu.org ([209.51.188.92]:48698 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfpiC-0007Ck-BM for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 12:26:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfpi7-0003UF-CZ for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 12:26:16 -0500 Received: from odoacer.turtle-trading.net ([93.241.193.16]:41527) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfpi6-0003T4-Lp for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 12:26:11 -0500 Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1gfpi3-0003Cq-GP; Sat, 05 Jan 2019 18:26:07 +0100 Received: from benny by justinian.turtle-trading.net with local (Exim 4.89) (envelope-from ) id 1gfpi3-0001o1-6I; Sat, 05 Jan 2019 18:26:07 +0100 From: Benjamin Riefenstahl Date: Sat, 05 Jan 2019 18:26:06 +0100 Message-ID: <875zv3m2xd.fsf@turtle-trading.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 93.241.193.16 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -5.0 (-----) 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: -6.0 (------) When I resize images, using image-transform-fit-to-height or image-transform-fit-to-width, the scaling is performed but than image-transform-check-size is called and signals an error. This uses ImageMagick 6.9.7.4 as installed by Debian GNUS/Linux 9.6 (stretch). Also, because the scale factor is kept globally after that operation (is that intentional BTW?), loading other images afterwards also runs into that error, thus image-mode fails to execute and instead in new image buffers the raw bytes are shown. I can reproduce this on emacs-26 as well as master with "emacs -Q" with PBM and with JPEG images. In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-01-03 built on arrian Repository revision: f7ccac9f9d82019d4d5ba3182200422fbc9c7e67 Repository branch: harfbuzz Windowing system distributor 'The X.Org Foundation', version 11.0.11902000 System Description: Debian GNU/Linux 9 (stretch) Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: global-magit-file-mode: t magit-file-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t shell-dirtrack-mode: t desktop-save-mode: t display-time-mode: t diff-auto-refine-mode: t delete-selection-mode: t cua-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Features: (shadow sort mail-extr emacsbug sendmail pcmpl-unix dirtrack dired-aux whitespace compile ert pp ewoc man noutline outline tramp-archive tramp-gvfs zeroconf dbus xml tramp trampver tramp-compat tramp-loaddefs ucs-normalize parse-time magit-find-file edebug pulse xref project debug backtrace tabify misearch multi-isearch rect cl-print thingatpt eieio-opt speedbar sb-image ezimage dframe find-func help-fns bug-reference magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-collab ghub-graphql treepy graphql ghub url-http url-gw nsm url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode git-commit magit-git magit-section magit-utils crm magit-popup log-edit message rmc puny format-spec rfc822 mml mml-sec epa gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async shell pcomplete dash rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode dom nxml-util nxml-enc xmltok make-mode jka-compr image-mode tcl elec-pair imenu sh-script smie executable desktop frameset highline benny-calendar-cfg ange-ftp comint ansi-color ring benny-unicode generic-x cl autoinsert cc-mode cc-fonts cc-guess cc-menus cc-styles cc-align cc-cmds cc-engine cc-vars cc-defs ps-print ps-print-loaddefs ps-def lpr advice dired dired-loaddefs benny-x-clipboard disp-table mm-util mail-prsvr time server protbuf cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs vc-git diff-mode easy-mmode diary-lib diary-loaddefs cal-menu calendar cal-loaddefs delsel cua-base .loaddefs benny-tools browse-url autoload radix-tree lisp-mnt mule-util cus-edit cus-start cus-load wid-edit info finder-inf package let-alist derived pcase cl-extra help-mode easymenu url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq byte-opt gv bytecomp byte-compile cconv epg epg-config subr-x cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jan 2019 18:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Benjamin Riefenstahl Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.154671207424780 (code B ref 33990); Sat, 05 Jan 2019 18:15:02 +0000 Received: (at 33990) by debbugs.gnu.org; 5 Jan 2019 18:14:34 +0000 Received: from localhost ([127.0.0.1]:48061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfqSv-0006Rc-Mn for submit@debbugs.gnu.org; Sat, 05 Jan 2019 13:14:33 -0500 Received: from eggsout.gnu.org ([209.51.188.92]:53974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfqSu-0006RU-8E for 33990@debbugs.gnu.org; Sat, 05 Jan 2019 13:14:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfqSp-0002Y4-M7 for 33990@debbugs.gnu.org; Sat, 05 Jan 2019 13:14:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfqSp-0002Xl-Hn; Sat, 05 Jan 2019 13:14:27 -0500 Received: from [176.228.60.248] (port=4257 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gfqSn-0000kM-Dz; Sat, 05 Jan 2019 13:14:27 -0500 Date: Sat, 05 Jan 2019 20:13:59 +0200 Message-Id: <83a7kf0y6w.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <875zv3m2xd.fsf@turtle-trading.net> (message from Benjamin Riefenstahl on Sat, 05 Jan 2019 18:26:06 +0100) References: <875zv3m2xd.fsf@turtle-trading.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -0.0 (/) 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: -1.0 (-) > From: Benjamin Riefenstahl > Date: Sat, 05 Jan 2019 18:26:06 +0100 > > When I resize images, using image-transform-fit-to-height or > image-transform-fit-to-width, the scaling is performed but than > image-transform-check-size is called and signals an error. This uses > ImageMagick 6.9.7.4 as installed by Debian GNUS/Linux 9.6 (stretch). Please show the error message and the Lisp backtrace from the error, and also the values of the relevant variables. Thanks. From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jan 2019 09:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.154676594412915 (code B ref 33990); Sun, 06 Jan 2019 09:13:01 +0000 Received: (at 33990) by debbugs.gnu.org; 6 Jan 2019 09:12:24 +0000 Received: from localhost ([127.0.0.1]:48229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gg4To-0003MF-0K for submit@debbugs.gnu.org; Sun, 06 Jan 2019 04:12:24 -0500 Received: from odoacer.turtle-trading.net ([93.241.193.16]:60382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gg4Tl-0003Lx-64 for 33990@debbugs.gnu.org; Sun, 06 Jan 2019 04:12:22 -0500 Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1gg4Te-0003fb-Bn; Sun, 06 Jan 2019 10:12:14 +0100 Received: from benny by justinian.turtle-trading.net with local (Exim 4.89) (envelope-from ) id 1gg4Te-00060g-1a; Sun, 06 Jan 2019 10:12:14 +0100 From: Benjamin Riefenstahl References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> Date: Sun, 06 Jan 2019 10:12:13 +0100 In-Reply-To: <83a7kf0y6w.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Jan 2019 20:13:59 +0200") Message-ID: <87lg3yno9e.fsf@turtle-trading.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) 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: -1.0 (-) Eli Zaretskii writes: > Please show the error message and the Lisp backtrace from the error, > and also the values of the relevant variables. Values: size -> (995 . 1068) ; From image-display-size, i.e. the image dimensions (window-inside-pixel-edges) -> (8 0 933 970) And yes, the image is actually higher than the window, it can be scrolled. The original image is rather small, 75x80, and the difference, 1068 - 970 -> 98, is about the size of an original pixel after transformation, so this looks like a rounding problem. Maybe the code should adjust by one original pixel when it calculates the target height in image-transform-properties? Stacktrace: Debugger entered--Lisp error: (cl-assertion-failed ((= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) nil 1068 970)) cl--assertion-failed((= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) nil (1068 970) nil) (or (= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) (cl--assertion-failed '(= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) nil (list (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) (list))) (progn (or (= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) (cl--assertion-failed '(= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) nil (list (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) (list))) nil) (cl-assert (= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) t) (cond ((eq image-transform-resize 'fit-width) (cl-assert (= (car size) (- (nth 2 (window-inside-pixel-edges)) (nth 0 (window-inside-pixel-edges)))) t)) ((eq image-transform-resize 'fit-height) (cl-assert (= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) t))) (let ((size (image-display-size (image-get-display-property) t))) (cond ((eq image-transform-resize 'fit-width) (cl-assert (= (car size) (- (nth 2 (window-inside-pixel-edges)) (nth 0 (window-inside-pixel-edges)))) t)) ((eq image-transform-resize 'fit-height) (cl-assert (= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) t)))) (progn (let ((size (image-display-size (image-get-display-property) t))) (cond ((eq image-transform-resize 'fit-width) (cl-assert (= (car size) (- (nth 2 ...) (nth 0 ...))) t)) ((eq image-transform-resize 'fit-height) (cl-assert (= (cdr size) (- (nth 3 ...) (nth 1 ...))) t))))) (if (and (not (numberp image-transform-resize)) (boundp 'image-type) (eq image-type 'imagemagick)) (progn (let ((size (image-display-size (image-get-display-property) t))) (cond ((eq image-transform-resize 'fit-width) (cl-assert (= (car size) (- ... ...)) t)) ((eq image-transform-resize 'fit-height) (cl-assert (= (cdr size) (- ... ...)) t)))))) (when (and (not (numberp image-transform-resize)) (boundp 'image-type) (eq image-type 'imagemagick)) (let ((size (image-display-size (image-get-display-property) t))) (cond ((eq image-transform-resize 'fit-width) (cl-assert (= (car size) (- (nth 2 ...) (nth 0 ...))) t)) ((eq image-transform-resize 'fit-height) (cl-assert (= (cdr size) (- (nth 3 ...) (nth 1 ...))) t))))) image-transform-check-size() image-toggle-display-image() image-mode() set-auto-mode-0(image-mode nil) set-auto-mode() normal-mode(t) after-find-file(nil t) find-file-noselect-1(# "~/Projects/Mandaic-Font/src/199/att-fin-199.03.14...." nil nil "~/Projects/Mandaic-Font/src/199/att-fin-199.03.14...." (17829146 66305)) find-file-noselect("/home/benny/Projects/Mandaic-Font/src/199/att-fin-..." nil nil nil) find-file("/home/benny/Projects/Mandaic-Font/src/199/att-fin-...") dired-find-file() funcall-interactively(dired-find-file) call-interactively(dired-find-file nil nil) command-execute(dired-find-file) recursive-edit() debug(error (cl-assertion-failed ((= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) nil 1067 970))) cl--assertion-failed((= (cdr size) (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges)))) nil (1067 970) nil) image-transform-check-size() image-toggle-display-image() image-transform-fit-to-height() funcall-interactively(image-transform-fit-to-height) call-interactively(image-transform-fit-to-height nil nil) command-execute(image-transform-fit-to-height) From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Jan 2019 11:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Benjamin Riefenstahl Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.154729357714331 (code B ref 33990); Sat, 12 Jan 2019 11:47:01 +0000 Received: (at 33990) by debbugs.gnu.org; 12 Jan 2019 11:46:17 +0000 Received: from localhost ([127.0.0.1]:56582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1giHk0-0003j4-6A for submit@debbugs.gnu.org; Sat, 12 Jan 2019 06:46:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1giHjy-0003iq-Gg for 33990@debbugs.gnu.org; Sat, 12 Jan 2019 06:46:15 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giHjt-0000je-BB; Sat, 12 Jan 2019 06:46:09 -0500 Received: from [176.228.60.248] (port=2336 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1giHjs-00015j-VG; Sat, 12 Jan 2019 06:46:09 -0500 Date: Sat, 12 Jan 2019 13:45:50 +0200 Message-Id: <83fttyf6a9.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87lg3yno9e.fsf@turtle-trading.net> (message from Benjamin Riefenstahl on Sun, 06 Jan 2019 10:12:13 +0100) References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) 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: -1.0 (-) > From: Benjamin Riefenstahl > Cc: 33990@debbugs.gnu.org > Date: Sun, 06 Jan 2019 10:12:13 +0100 > > Eli Zaretskii writes: > > Please show the error message and the Lisp backtrace from the error, > > and also the values of the relevant variables. > > Values: > > size -> (995 . 1068) ; From image-display-size, i.e. the image dimensions > (window-inside-pixel-edges) -> (8 0 933 970) > > And yes, the image is actually higher than the window, it can be > scrolled. The original image is rather small, 75x80, and the > difference, 1068 - 970 -> 98, is about the size of an original pixel > after transformation, so this looks like a rounding problem. Maybe the > code should adjust by one original pixel when it calculates the target > height in image-transform-properties? Looks like your analysis is correct, thanks. Can you propose a patch that would implement your suggestion? From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Jan 2019 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.154749127012158 (code B ref 33990); Mon, 14 Jan 2019 18:42:01 +0000 Received: (at 33990) by debbugs.gnu.org; 14 Jan 2019 18:41:10 +0000 Received: from localhost ([127.0.0.1]:59333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gj7Ab-0003A2-S4 for submit@debbugs.gnu.org; Mon, 14 Jan 2019 13:41:10 -0500 Received: from odoacer.turtle-trading.net ([93.241.193.16]:42076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gj7AZ-00039g-BB for 33990@debbugs.gnu.org; Mon, 14 Jan 2019 13:41:08 -0500 Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1gj7AS-0000N7-3v; Mon, 14 Jan 2019 19:41:00 +0100 Received: from benny by justinian.turtle-trading.net with local (Exim 4.89) (envelope-from ) id 1gj7AR-0005r6-Mo; Mon, 14 Jan 2019 19:40:59 +0100 From: Benjamin Riefenstahl References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> <83fttyf6a9.fsf@gnu.org> Date: Mon, 14 Jan 2019 19:40:58 +0100 In-Reply-To: <83fttyf6a9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Jan 2019 13:45:50 +0200") Message-ID: <87muo3krph.fsf@turtle-trading.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) 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: -1.0 (-) Hi Eli, Eli Zaretskii writes: > Looks like your analysis is correct, thanks. Can you propose a patch > that would implement your suggestion? Just to let you know, I am on it, though slowly. I just found out that the problem reproduces on my laptop, but not on my desktop machine. Either it's the difference in display size or some different library version. Although last I looked at it on my laptop, it seemed to be a problem in the Emacs code somewhere between image-size and compute_image_size. To be continued... benny From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Jan 2019 18:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Benjamin Riefenstahl Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.154749201413772 (code B ref 33990); Mon, 14 Jan 2019 18:54:02 +0000 Received: (at 33990) by debbugs.gnu.org; 14 Jan 2019 18:53:34 +0000 Received: from localhost ([127.0.0.1]:59341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gj7Mc-0003a4-Ca for submit@debbugs.gnu.org; Mon, 14 Jan 2019 13:53:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gj7Ma-0003Zk-Bn for 33990@debbugs.gnu.org; Mon, 14 Jan 2019 13:53:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj7MT-0008Nn-N6; Mon, 14 Jan 2019 13:53:26 -0500 Received: from [176.228.60.248] (port=4381 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gj7MT-0000u3-Fo; Mon, 14 Jan 2019 13:53:25 -0500 Date: Mon, 14 Jan 2019 20:53:13 +0200 Message-Id: <835zurdqau.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87muo3krph.fsf@turtle-trading.net> (message from Benjamin Riefenstahl on Mon, 14 Jan 2019 19:40:58 +0100) References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> <83fttyf6a9.fsf@gnu.org> <87muo3krph.fsf@turtle-trading.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) 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: -1.0 (-) > From: Benjamin Riefenstahl > Cc: 33990@debbugs.gnu.org > Date: Mon, 14 Jan 2019 19:40:58 +0100 > > Eli Zaretskii writes: > > Looks like your analysis is correct, thanks. Can you propose a patch > > that would implement your suggestion? > > Just to let you know, I am on it, though slowly. Thank you. From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jan 2019 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.154758833424915 (code B ref 33990); Tue, 15 Jan 2019 21:39:01 +0000 Received: (at 33990) by debbugs.gnu.org; 15 Jan 2019 21:38:54 +0000 Received: from localhost ([127.0.0.1]:60425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjWQ9-0006Tn-Vm for submit@debbugs.gnu.org; Tue, 15 Jan 2019 16:38:54 -0500 Received: from odoacer.turtle-trading.net ([93.241.193.16]:43366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjWQ3-0006TT-Lf for 33990@debbugs.gnu.org; Tue, 15 Jan 2019 16:38:48 -0500 Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1gjWPx-000159-71; Tue, 15 Jan 2019 22:38:41 +0100 Received: from benny by justinian.turtle-trading.net with local (Exim 4.89) (envelope-from ) id 1gjWPw-0003nI-Ps; Tue, 15 Jan 2019 22:38:40 +0100 From: Benjamin Riefenstahl References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> <83fttyf6a9.fsf@gnu.org> Date: Tue, 15 Jan 2019 22:38:40 +0100 In-Reply-To: <83fttyf6a9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Jan 2019 13:45:50 +0200") Message-ID: <87va2p8uu7.fsf@turtle-trading.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) 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: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Can you propose a patch that would implement your suggestion? It looks like my analysis was wrong. The problem is rather that create-image applies a default scaling, when :scale is not given. This depends on the font size (only if char-width > 10 pixels), which explains why it happens on my laptop but not on my desktop machine. I guess create-image is targeting image resources like toolbar buttons, where it may be a good idea to scale the images with the fonts for so-called "hidpi" displays. But for image-mode the situation is different and I at least do not want that behaviour. I attach three patches, the first is a minimal change that fixes the problem for me. The second adds to the doc string of create-image, because I think that its behaviour is unexpected enough to warrant highlighting. The third makes the image-mode transform parameters buffer-local, because that seems more appropriate and even complies with the doc string form image-transform-rotation better. This third patch changes behaviour, though, so maybe a second opinion is in order. The patches are against master, I haven't tested if they apply against emacs-26. Let me know if there is something that needs to be changed. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-image-mode-Do-not-use-default-scaling-bug-33990.patch >From 951eadeb77c665c9d419e982b3651f401ad5240a Mon Sep 17 00:00:00 2001 From: Benjamin Riefenstahl Date: Mon, 14 Jan 2019 23:37:03 +0100 Subject: [PATCH 1/4] image-mode: Do not use default scaling (bug#33990) * lisp/image-mode.el (image-toggle-display-image): Set :scale == 1 so that create-image does not apply additional scaling. --- lisp/image-mode.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 3570c7cba4..7f290719bb 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -741,9 +741,11 @@ image-toggle-display-image (type (if (image--imagemagick-wanted-p filename) 'imagemagick (image-type file-or-data nil data-p))) + ;; :scale 1: If we do not set this, create-image will apply + ;; default scaling based on font size. (image (if (not edges) - (create-image file-or-data type data-p) - (create-image file-or-data type data-p + (create-image file-or-data type data-p :scale 1) + (create-image file-or-data type data-p :scale 1 :max-width (- (nth 2 edges) (nth 0 edges)) :max-height (- (nth 3 edges) (nth 1 edges))))) (inhibit-read-only t) -- 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-create-image-Expand-documentation-bug-33990.patch >From ab0bb7674a702a2d142c6e7790c26fb880484591 Mon Sep 17 00:00:00 2001 From: Benjamin Riefenstahl Date: Tue, 15 Jan 2019 17:00:04 +0100 Subject: [PATCH 2/4] create-image: Expand documentation (bug#33990) * lisp/image.el (create-image): Discuss default for :scale in the doc string. --- lisp/image.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/image.el b/lisp/image.el index 2e84e47b5c..3aa3b0aa24 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -415,13 +415,20 @@ image-type-auto-detected-p (defun create-image (file-or-data &optional type data-p &rest props) "Create an image. FILE-OR-DATA is an image file name or image data. + Optional TYPE is a symbol describing the image type. If TYPE is omitted or nil, try to determine the image type from its first few bytes of image data. If that doesn't work, and FILE-OR-DATA is a file name, use its file extension as image type. + Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. + Optional PROPS are additional image attributes to assign to the image, -like, e.g. `:mask MASK'. +like, e.g. `:mask MASK'. If the property `:scale' is not given and the +display has a high resolution (more exactly, when the average width of a +character in the default font is more than 10 pixels), the image is +automatically scaled up in proportion to the default font. + Value is the image created, or nil if images of type TYPE are not supported. Images should not be larger than specified by `max-image-size'. -- 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0003-image-mode-Make-parameters-buffer-local.patch >From aa78a077b2eaf5d844f0c8e65f7ac3354c07cfb4 Mon Sep 17 00:00:00 2001 From: Benjamin Riefenstahl Date: Sat, 12 Jan 2019 15:36:24 +0100 Subject: [PATCH 3/4] image-mode: Make parameters buffer-local Image parameters were treated as image specific, but because they actually were global variables, their behaviour transfered to new images. * lisp/image-mode.el (image-transform-resize, image-transform-scale) (image-transform-rotation): Declare with defvar-local. --- lisp/image-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7f290719bb..fa1362c471 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -53,7 +53,7 @@ image-mode-new-window-functions It is called with one argument, the initial WINPROPS.") ;; FIXME this doesn't seem mature yet. Document in manual when it is. -(defvar image-transform-resize nil +(defvar-local image-transform-resize nil "The image resize operation. Its value should be one of the following: - nil, meaning no resizing. @@ -61,10 +61,10 @@ image-transform-resize - `fit-width', meaning to fit the image to the window width. - A number, which is a scale factor (the default size is 1).") -(defvar image-transform-scale 1.0 +(defvar-local image-transform-scale 1.0 "The scale factor of the image being displayed.") -(defvar image-transform-rotation 0.0 +(defvar-local image-transform-rotation 0.0 "Rotation angle for the image in the current Image mode buffer.") (defvar image-transform-right-angle-fudge 0.0001 -- 2.11.0 --=-=-=-- From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Jan 2019 08:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Benjamin Riefenstahl Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.15478865848755 (code B ref 33990); Sat, 19 Jan 2019 08:30:03 +0000 Received: (at 33990) by debbugs.gnu.org; 19 Jan 2019 08:29:44 +0000 Received: from localhost ([127.0.0.1]:37286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkm0e-0002H9-88 for submit@debbugs.gnu.org; Sat, 19 Jan 2019 03:29:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkm0d-0002Gv-43 for 33990@debbugs.gnu.org; Sat, 19 Jan 2019 03:29:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkm0V-0008E3-0J; Sat, 19 Jan 2019 03:29:37 -0500 Received: from [176.228.60.248] (port=4837 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gkm0R-0000bb-8H; Sat, 19 Jan 2019 03:29:33 -0500 Date: Sat, 19 Jan 2019 10:29:11 +0200 Message-Id: <83imylaw4o.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87va2p8uu7.fsf@turtle-trading.net> (message from Benjamin Riefenstahl on Tue, 15 Jan 2019 22:38:40 +0100) References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> <83fttyf6a9.fsf@gnu.org> <87va2p8uu7.fsf@turtle-trading.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) 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: -1.0 (-) > From: Benjamin Riefenstahl > Cc: 33990@debbugs.gnu.org > Date: Tue, 15 Jan 2019 22:38:40 +0100 > > Eli Zaretskii writes: > > Can you propose a patch that would implement your suggestion? > > It looks like my analysis was wrong. The problem is rather that > create-image applies a default scaling, when :scale is not given. This > depends on the font size (only if char-width > 10 pixels), which > explains why it happens on my laptop but not on my desktop machine. I > guess create-image is targeting image resources like toolbar buttons, > where it may be a good idea to scale the images with the fonts for > so-called "hidpi" displays. But for image-mode the situation is > different and I at least do not want that behaviour. > > I attach three patches, the first is a minimal change that fixes the > problem for me. The second adds to the doc string of create-image, > because I think that its behaviour is unexpected enough to warrant > highlighting. The third makes the image-mode transform parameters > buffer-local, because that seems more appropriate and even complies with > the doc string form image-transform-rotation better. This third patch > changes behaviour, though, so maybe a second opinion is in order. > > The patches are against master, I haven't tested if they apply against > emacs-26. Let me know if there is something that needs to be changed. Thanks, this LGTM. I will wait for a few days for comments, and pushd these if no objections are heard. I understand these are not recent regressions? If so, I think the master branch is where they should go. But if you think the bug is grave enough, I could consider them for the emacs-26 branch instead. From unknown Sun Jun 15 08:59:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Jan 2019 17:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 33990@debbugs.gnu.org Received: via spool by 33990-submit@debbugs.gnu.org id=B33990.15479184779864 (code B ref 33990); Sat, 19 Jan 2019 17:22:01 +0000 Received: (at 33990) by debbugs.gnu.org; 19 Jan 2019 17:21:17 +0000 Received: from localhost ([127.0.0.1]:38036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkuJ2-0002Z2-L8 for submit@debbugs.gnu.org; Sat, 19 Jan 2019 12:21:16 -0500 Received: from odoacer.turtle-trading.net ([93.241.193.16]:47780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkuJ1-0002Yp-BJ for 33990@debbugs.gnu.org; Sat, 19 Jan 2019 12:21:15 -0500 Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1gkuIt-0003Ij-Fz; Sat, 19 Jan 2019 18:21:07 +0100 Received: from benny by justinian.turtle-trading.net with local (Exim 4.89) (envelope-from ) id 1gkuIt-00040a-4A; Sat, 19 Jan 2019 18:21:07 +0100 From: Benjamin Riefenstahl References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> <83fttyf6a9.fsf@gnu.org> <87va2p8uu7.fsf@turtle-trading.net> <83imylaw4o.fsf@gnu.org> Date: Sat, 19 Jan 2019 18:21:06 +0100 In-Reply-To: <83imylaw4o.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Jan 2019 10:29:11 +0200") Message-ID: <87o98clg1p.fsf@turtle-trading.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) 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: -1.0 (-) Hi Eli, Eli Zaretskii writes: > I understand these are not recent regressions? If so, I think the > master branch is where they should go. But if you think the bug is > grave enough, I could consider them for the emacs-26 branch instead. It seems that automatic scaling was added to create-image in february 2016, so the bug may have been there since than. How about fixing the bug and documentation on emacs-26 (patches 1 and 2) and making the behaviour change (patch 3) on master? I think the bug fix (patch 1) is obviously right and not likely to cause problems. OTOH, without it, once I had invoked an image transform I could not use image-mode for any new images any more in that same Emacs session. Thanks, benny From unknown Sun Jun 15 08:59:57 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: Benjamin Riefenstahl Subject: bug#33990: closed (Re: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert) Message-ID: References: <834l9x6sqw.fsf@gnu.org> <875zv3m2xd.fsf@turtle-trading.net> X-Gnu-PR-Message: they-closed 33990 X-Gnu-PR-Package: emacs Reply-To: 33990@debbugs.gnu.org Date: Fri, 25 Jan 2019 08:35:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1548405302-28004-1" This is a multi-part message in MIME format... ------------=_1548405302-28004-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #33990: 27.0.50; image-transform-fit-to-height/-width violates assert 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 33990@debbugs.gnu.org. --=20 33990: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D33990 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1548405302-28004-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 33990-done) by debbugs.gnu.org; 25 Jan 2019 08:34:14 +0000 Received: from localhost ([127.0.0.1]:44486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gmwwH-0007GY-ID for submit@debbugs.gnu.org; Fri, 25 Jan 2019 03:34:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gmwwF-0007GM-SK for 33990-done@debbugs.gnu.org; Fri, 25 Jan 2019 03:34:12 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmww8-0007cN-KH; Fri, 25 Jan 2019 03:34:06 -0500 Received: from [176.228.60.248] (port=2026 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gmww7-0003K1-6L; Fri, 25 Jan 2019 03:34:04 -0500 Date: Fri, 25 Jan 2019 10:33:59 +0200 Message-Id: <834l9x6sqw.fsf@gnu.org> From: Eli Zaretskii To: Benjamin Riefenstahl In-reply-to: <87o98clg1p.fsf@turtle-trading.net> (message from Benjamin Riefenstahl on Sat, 19 Jan 2019 18:21:06 +0100) Subject: Re: bug#33990: 27.0.50; image-transform-fit-to-height/-width violates assert References: <875zv3m2xd.fsf@turtle-trading.net> <83a7kf0y6w.fsf@gnu.org> <87lg3yno9e.fsf@turtle-trading.net> <83fttyf6a9.fsf@gnu.org> <87va2p8uu7.fsf@turtle-trading.net> <83imylaw4o.fsf@gnu.org> <87o98clg1p.fsf@turtle-trading.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33990-done Cc: 33990-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: -1.0 (-) > From: Benjamin Riefenstahl > Cc: 33990@debbugs.gnu.org > Date: Sat, 19 Jan 2019 18:21:06 +0100 > > How about fixing the bug and documentation on emacs-26 (patches 1 and 2) > and making the behaviour change (patch 3) on master? Done, thanks. ------------=_1548405302-28004-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Jan 2019 17:26:22 +0000 Received: from localhost ([127.0.0.1]:48037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfpiG-0003G7-To for submit@debbugs.gnu.org; Sat, 05 Jan 2019 12:26:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfpiE-0003Fy-JZ for submit@debbugs.gnu.org; Sat, 05 Jan 2019 12:26:19 -0500 Received: from [209.51.188.17] (port=54730 helo=lists.gnu.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfpiD-0003Wg-J4 for submit@debbugs.gnu.org; Sat, 05 Jan 2019 12:26:18 -0500 Received: from eggsout.gnu.org ([209.51.188.92]:48698 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfpiC-0007Ck-BM for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 12:26:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfpi7-0003UF-CZ for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 12:26:16 -0500 Received: from odoacer.turtle-trading.net ([93.241.193.16]:41527) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfpi6-0003T4-Lp for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 12:26:11 -0500 Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1gfpi3-0003Cq-GP; Sat, 05 Jan 2019 18:26:07 +0100 Received: from benny by justinian.turtle-trading.net with local (Exim 4.89) (envelope-from ) id 1gfpi3-0001o1-6I; Sat, 05 Jan 2019 18:26:07 +0100 From: Benjamin Riefenstahl To: bug-gnu-emacs@gnu.org Subject: 27.0.50; image-transform-fit-to-height/-width violates assert Date: Sat, 05 Jan 2019 18:26:06 +0100 Message-ID: <875zv3m2xd.fsf@turtle-trading.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 93.241.193.16 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -5.0 (-----) 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: -6.0 (------) When I resize images, using image-transform-fit-to-height or image-transform-fit-to-width, the scaling is performed but than image-transform-check-size is called and signals an error. This uses ImageMagick 6.9.7.4 as installed by Debian GNUS/Linux 9.6 (stretch). Also, because the scale factor is kept globally after that operation (is that intentional BTW?), loading other images afterwards also runs into that error, thus image-mode fails to execute and instead in new image buffers the raw bytes are shown. I can reproduce this on emacs-26 as well as master with "emacs -Q" with PBM and with JPEG images. In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-01-03 built on arrian Repository revision: f7ccac9f9d82019d4d5ba3182200422fbc9c7e67 Repository branch: harfbuzz Windowing system distributor 'The X.Org Foundation', version 11.0.11902000 System Description: Debian GNU/Linux 9 (stretch) Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: global-magit-file-mode: t magit-file-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t shell-dirtrack-mode: t desktop-save-mode: t display-time-mode: t diff-auto-refine-mode: t delete-selection-mode: t cua-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Features: (shadow sort mail-extr emacsbug sendmail pcmpl-unix dirtrack dired-aux whitespace compile ert pp ewoc man noutline outline tramp-archive tramp-gvfs zeroconf dbus xml tramp trampver tramp-compat tramp-loaddefs ucs-normalize parse-time magit-find-file edebug pulse xref project debug backtrace tabify misearch multi-isearch rect cl-print thingatpt eieio-opt speedbar sb-image ezimage dframe find-func help-fns bug-reference magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-collab ghub-graphql treepy graphql ghub url-http url-gw nsm url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode git-commit magit-git magit-section magit-utils crm magit-popup log-edit message rmc puny format-spec rfc822 mml mml-sec epa gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async shell pcomplete dash rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode dom nxml-util nxml-enc xmltok make-mode jka-compr image-mode tcl elec-pair imenu sh-script smie executable desktop frameset highline benny-calendar-cfg ange-ftp comint ansi-color ring benny-unicode generic-x cl autoinsert cc-mode cc-fonts cc-guess cc-menus cc-styles cc-align cc-cmds cc-engine cc-vars cc-defs ps-print ps-print-loaddefs ps-def lpr advice dired dired-loaddefs benny-x-clipboard disp-table mm-util mail-prsvr time server protbuf cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs vc-git diff-mode easy-mmode diary-lib diary-loaddefs cal-menu calendar cal-loaddefs delsel cua-base .loaddefs benny-tools browse-url autoload radix-tree lisp-mnt mule-util cus-edit cus-start cus-load wid-edit info finder-inf package let-alist derived pcase cl-extra help-mode easymenu url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq byte-opt gv bytecomp byte-compile cconv epg epg-config subr-x cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) ------------=_1548405302-28004-1--