GNU bug report logs -
#51596
image-transform-resize has inconsistent semantics wrt scaling up/down
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Thu, 4 Nov 2021 04:16:01 UTC
Severity: normal
Tags: patch
Fixed in version 29.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I find the semantics of `image-transform-resize' inconsistent. That
also goes for `image-auto-resize' and the corresponding functions.
"Fit height" and "fit width" both scales an image up or down, but "fit
height and width" only scales an image down. Is that intentional?
I would have expected that they all scale in the same way, i.e. they
should all either scale up or down, or scale down only, or scale up
only.
My preference is that they scale both up or down, no matter which kind
of fitting you ask for. The below diff seems to achieve what I want.
However, I'm not sure if the semantics should be changed in this way,
as I don't know if the old semantics were intentional or not.
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 4a326cdc69..97efd8254d 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -880,7 +880,7 @@ image-toggle-display-image
:format (and filename data-p))
(create-image file-or-data type data-p :scale 1
:max-width max-width
- :max-height max-height
+ :height max-height
;; Type hint.
:format (and filename data-p))))
This bug report was last modified 3 years and 198 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.