unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: 74725@debbugs.gnu.org, da_vid@orange.fr, alan@idiocy.org
Subject: bug#74725: 31.0.50; image-scaling-factor is ignored by create-image
Date: Sun, 08 Dec 2024 14:15:02 +0200	[thread overview]
Message-ID: <86plm2fk1l.fsf@gnu.org> (raw)
In-Reply-To: <87h67eha9b.fsf@yahoo.com> (message from Po Lu on Sun, 08 Dec 2024 16:03:28 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: da_vid@orange.fr,  alan@idiocy.org,  74725@debbugs.gnu.org
> Date: Sun, 08 Dec 2024 16:03:28 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> > Po Lu, what were the reasons for that particular part of the commit?
> >> 
> >> The scale applied by image-scaling-factor is liable to differ by
> >> display
> >
> > How so?  Please elaborate.
> 
> When it is set to `auto' (the default value), the scaling factor to be
> applied is decided by the configuration of a frame, namely, its
> FRAME_COLUMN_WIDTH.

So when the default font changes, all the images are supposed to be
resized?  Does that really happen, and if so, is that a good idea in
all cases?

> >> and computing the default scale in Lisp would result in images
> >> being displayed with an incorrect scale in the presence of multiple
> >> displays.
> >
> > How does the above changeset solve this problem, then?
> 
> By moving its application to image.c, which knows where an image is
> being displayed and can apply specific scales for each frame.

But, as this bug seems to indicate, that solution doesn't always work?

> >> Image caches must be flushed when image-scaling-factor is modified,
> >> unless it is set to `auto' and a display's scale changes, because
> >> image.c has no means of detecting variable modifications and so only the
> >> latter event can be automatically detected.
> >
> > Please describe the issue in more detail, as I don't think I follow
> > what you are saying here.  If we need to detect changes in variables,
> > we can use the add-variable-watcher technique, similar to what we do
> > in frame.el with variables that need to force redisplay (but maybe I
> > don't understand the problem you are describing).
> >
> > In any case, I don't think changes in image-scaling-factor are
> > supposed to be immediately reflected on display, if that's what you
> > have in mind.  This is not the documented effect of this variable.
> 
> What I am trying to communicate is that changes to
> `image-scaling-factor' must be accompanied by flushing the image cache
> if it is to take effect on all previously displayed images.  This isn't
> a problem, and the OP should simply flush the image cache after
> modifying image-scaling-factor, rather than rely on the erroneous
> behavior of find-image which was removed.

OK, so do you consider the solution of recording the scale factor in
the cache a reasonable one?





      reply	other threads:[~2024-12-08 12:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 12:13 bug#74725: 31.0.50; image-scaling-factor is ignored by create-image David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 12:41 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 14:49 ` Eli Zaretskii
2024-12-07 15:49   ` Alan Third
2024-12-07 16:21     ` Eli Zaretskii
2024-12-07 16:32       ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 16:27     ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 16:45       ` Eli Zaretskii
2024-12-08  0:01         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08  6:03           ` Eli Zaretskii
2024-12-08  8:03             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08 12:15               ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86plm2fk1l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=74725@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=da_vid@orange.fr \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).