all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#51596: image-transform-resize has inconsistent semantics wrt scaling up/down
@ 2021-11-04  4:14 Stefan Kangas
  2021-11-04 17:50 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Kangas @ 2021-11-04  4:14 UTC (permalink / raw)
  To: 51596

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))))





^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-06 19:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04  4:14 bug#51596: image-transform-resize has inconsistent semantics wrt scaling up/down Stefan Kangas
2021-11-04 17:50 ` Lars Ingebrigtsen
2021-11-04 18:52   ` Stefan Kangas
2021-11-04 19:16     ` Juri Linkov
2021-11-04 19:41       ` Stefan Kangas
2021-11-04 19:49         ` Juri Linkov
2021-11-04 20:19           ` Stefan Kangas
2021-11-04 22:52     ` Lars Ingebrigtsen
2021-11-05  4:07       ` Stefan Kangas
2021-11-05 13:22         ` Lars Ingebrigtsen
2021-11-06 18:49           ` Juri Linkov
2021-11-06 19:49             ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.