From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: create-image and find-image consistency Date: Thu, 30 Apr 2020 09:39:27 -0400 Message-ID: <952cd192-cd58-26d8-2e56-3606b2e6079d@gmail.com> References: <3a9c34ae-8052-d634-78c3-e83a2f6b6624@orange.fr> <87ees536hl.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="31368"; 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 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 30 15:43:11 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jU9T4-00083F-Um for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Apr 2020 15:43:10 +0200 Original-Received: from localhost ([::1]:53274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU9T3-0000Dn-Sm for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Apr 2020 09:43:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49140) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU9QI-0004Ue-6g for emacs-devel@gnu.org; Thu, 30 Apr 2020 09:41:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU9PY-0007hu-EA for emacs-devel@gnu.org; Thu, 30 Apr 2020 09:40:17 -0400 Original-Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:36108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU9PX-0007a4-UT for emacs-devel@gnu.org; Thu, 30 Apr 2020 09:39:32 -0400 Original-Received: by mail-qv1-xf2f.google.com with SMTP id w18so2979576qvs.3 for ; Thu, 30 Apr 2020 06:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=mQ+fPDrDXTJgKt31tjLpEDrqKzNRLmv3iem6JlTxAq4=; b=BuV1gkO2h9IOdWTrjDfLmhSLI+9GEv80faTWF12ylwflVh9TZwsMiJFRSX7jhGIHXp 3q4ox6onbp1+fjUo+ITmEzzkmWmHRJwreuTwaHyxNSjOEafgsu1OqnQ3pFFCdp0dQnxE Ey6EX1qjWD84P/WpzV1pl4z5LJkoaiy+7p+CbzTR55Yz6zUzKfhEMikFcnmNjQnCgbc1 UOiubdbK+9zifnV7s4U8vMAaqpDdvEj+QF3nHRVeHruRnwurhhP0s4S4NOkkIFmrT4f5 bRpVVhhdg8/8vt2/3GYqA4jAAn4HmO9m9WD9aHa5I/FE6aq8kQhzZU3eQBt+KJG8vGy6 PNGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mQ+fPDrDXTJgKt31tjLpEDrqKzNRLmv3iem6JlTxAq4=; b=CfhECe3ChrdHaN/fnJABT/gYfS/zv0uI+V3r478Rqfqjf818bRwj+ENw1lkIHjFGV7 FaB9PeiKaoN42JHt03BI8tPBG81AIjTviASIq45seDw1FFh29TP+UiFk1q/BJXHLSxsW WyvnZBhtWb67BolpTfbAdBeNarGLIDf57udArZLDNYWGFS1cSnPtmQttmaaZV2eJ+LdL bdV40MkZ+uPImg1AIGZJXiXF9Vubp+KkJV0OSR4/kxlT4e9B2X2VGfx6Ftu2zn9AbPqV QbjQtXazqb4v+L5JNuRDPbZ73EQCFZ+vazmunDpxwI6kgGU6wIGkwvJQRLsRpExV95uZ /3cA== X-Gm-Message-State: AGi0PubWTwzVsM3kktFZQUTd1h9NP4n95Gw/Kl32C048wiFv2yBy6XvW WJKXZhHif1V+dxpSZCwWgN4lwl7a X-Google-Smtp-Source: APiQypJnn3y8FfkCMkEuLfPaFmpqEq6QpVMP4T65KxhDZHYdJ6f+vMpPVnIDRT00s1qP/MV5F507lw== X-Received: by 2002:ad4:54c3:: with SMTP id j3mr3051507qvx.241.1588253970264; Thu, 30 Apr 2020 06:39:30 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:f4e8:31c1:7b74:7617? ([2601:184:4180:66e7:f4e8:31c1:7b74:7617]) by smtp.googlemail.com with ESMTPSA id h25sm2040861qto.87.2020.04.30.06.39.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2020 06:39:29 -0700 (PDT) In-Reply-To: Content-Language: en-GB Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=cpitclaudel@gmail.com; helo=mail-qv1-xf2f.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::f2f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248234 Archived-At: On 30/04/2020 05.24, David Ponce wrote: > 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 ;-) One problem is that SVG scaling is broken at the moment, so auto-scaling SVGs yields blurry results, so it's not clear that scaling is in fact desirable for tool bars. Additionally, the scaling that create-image does is based on font size, right? Do we expect font size changes to change the size of tab bar icons?