GNU bug report logs - #74725
31.0.50; image-scaling-factor is ignored by create-image

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Sat, 7 Dec 2024 12:15:02 UTC

Severity: normal

Found in version 31.0.50

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com
Cc: 74725 <at> debbugs.gnu.org, da_vid <at> orange.fr, alan <at> idiocy.org
Subject: bug#74725: 31.0.50; image-scaling-factor is ignored by create-image
Date: Sat, 21 Dec 2024 11:14:50 +0200
Ping!

> Cc: 74725 <at> debbugs.gnu.org, da_vid <at> orange.fr, alan <at> idiocy.org
> Date: Sun, 08 Dec 2024 14:15:02 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Po Lu <luangruo <at> yahoo.com>
> > Cc: da_vid <at> orange.fr,  alan <at> idiocy.org,  74725 <at> debbugs.gnu.org
> > Date: Sun, 08 Dec 2024 16:03:28 +0800
> > 
> > Eli Zaretskii <eliz <at> 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?
> 
> 
> 
> 




This bug report was last modified 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.