From: David Ponce <da_vid@orange.fr>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org, 40978@debbugs.gnu.org
Subject: bug#40978: create-image and find-image consistency
Date: Thu, 30 Apr 2020 11:24:30 +0200 [thread overview]
Message-ID: <dd80335a-54cd-80ba-ed1e-8be9b7e8278e@orange.fr> (raw)
In-Reply-To: <87ees536hl.fsf@gnus.org>
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!
next prev parent reply other threads:[~2020-04-30 9:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3a9c34ae-8052-d634-78c3-e83a2f6b6624@orange.fr>
2020-04-30 8:53 ` bug#40978: 28.0.50; create-image and find-image consistency David Ponce
[not found] ` <87ees536hl.fsf@gnus.org>
2020-04-30 9:24 ` David Ponce [this message]
2020-04-30 22:05 ` bug#40978: " Lars Ingebrigtsen
2022-06-20 9:38 ` bug#40978: bug#47039: 27.1; find-image ignores image-scaling-factor Lars Ingebrigtsen
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=dd80335a-54cd-80ba-ed1e-8be9b7e8278e@orange.fr \
--to=da_vid@orange.fr \
--cc=40978@debbugs.gnu.org \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/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).