From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: David Ponce Newsgroups: gmane.emacs.bugs,gmane.emacs.devel Subject: bug#40978: create-image and find-image consistency Date: Thu, 30 Apr 2020 11:24:30 +0200 Message-ID: References: <3a9c34ae-8052-d634-78c3-e83a2f6b6624@orange.fr> <87ees536hl.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="25848"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: emacs-devel@gnu.org, 40978@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 30 11:25:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jU5RP-0006au-Kb for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 11:25:11 +0200 Original-Received: from localhost ([::1]:49538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU5RO-0004l7-Gd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 05:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46972) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU5RH-0004ji-5K for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2020 05:25:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU5RG-00020i-JL for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2020 05:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU5RG-00020d-6O for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2020 05:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jU5RF-0008Sb-US for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2020 05:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Ponce Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Apr 2020 09:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40978 X-GNU-PR-Package: emacs Original-Received: via spool by 40978-submit@debbugs.gnu.org id=B40978.158823869532502 (code B ref 40978); Thu, 30 Apr 2020 09:25:01 +0000 Original-Received: (at 40978) by debbugs.gnu.org; 30 Apr 2020 09:24:55 +0000 Original-Received: from localhost ([127.0.0.1]:45370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jU5Qu-0008Rw-1v for submit@debbugs.gnu.org; Thu, 30 Apr 2020 05:24:54 -0400 Original-Received: from smtp10.smtpout.orange.fr ([80.12.242.132]:26995 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jU5Qt-0008Ri-14 for 40978@debbugs.gnu.org; Thu, 30 Apr 2020 05:24:39 -0400 Original-Received: from [192.168.1.25] ([92.129.178.87]) by mwinf5d88 with ME id YxQX220061tXeyc03xQX66; Thu, 30 Apr 2020 11:24:32 +0200 X-ME-Helo: [192.168.1.25] X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI= X-ME-Date: Thu, 30 Apr 2020 11:24:32 +0200 X-ME-IP: 92.129.178.87 In-Reply-To: <87ees536hl.fsf@gnus.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179380 gmane.emacs.devel:248218 Archived-At: 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!