GNU bug report logs - #40978
28.0.50; create-image and find-image consistency

Previous Next

Package: emacs;

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

Date: Thu, 30 Apr 2020 08:54:01 UTC

Severity: normal

Merged with 47039

Found in versions 27.1, 28.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: David Ponce <da_vid <at> orange.fr>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 40978 <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: bug#40978: create-image and find-image consistency
Date: Thu, 30 Apr 2020 11:24:30 +0200
On 30/04/2020 07:08, Lars Ingebrigtsen wrote:
> 
> I think it conceptually makes sense to have find-image use create-image,
> but looking at the code, and where find-image is used, it looks like the
> use case it for creating toolbars and the like, where you want to pick
> out one of the (built-in) image formats that Emacs supports...
> 
> Looking at your patch, you remove the (image-type-available-p type), and
> instead rely on create-image not bugging out instead?  That feels like a
> less obvious way to do the test (and more breakable; there may be other
> reasons create-image fails).
> 
> And I'm not 100% sure that we want to auto-scale toolbars and the like.
> I'm pretty sure we do, but perhaps somebody else has an opinion here?
> 
> Anyway, I think you should file this as a bug report so that the patch
> doesn't get lost, because I think you're basically correct that the
> find-image behaviour should be changed.
> 

Hi Lars,

I created bug report #40978 as suggested.

My idea was to better separate the role of find-image from
create-image:

- create-image to actually make a new image based on given specs, and
  maybe some common options and device capabilities (for example, auto
  scaling based on screen resolution).
  
- find-image to lookup for an image in the file system or in raw data,
  but delegating to create-image the actual creation of the image.

Currently find-image & create-image can return a different image from
the same spec, which is not consistent. My patch proposes to fix such
potential inconsistencies.
When you don't need auto-scaling for example, you can pass :scale 1.0
to find-image, like you would have done with create-image :-)
IMHO, auto-scaling is particularly useful with graphics elements like
tool bars, tab bars, and widgets ;-)

Thanks for taking into account this proposal!




This bug report was last modified 2 years and 342 days ago.

Previous Next


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