From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Linking to ImageMagick by default Date: Sat, 29 Dec 2018 23:31:06 +0200 Organization: LINKOV.NET Message-ID: <87y3886uat.fsf@mail.linkov.net> References: <20181205223901.GA5543@breton.holly.idiocy.org> <20181208183810.GA2465@breton.holly.idiocy.org> <20181210220944.GA4793@breton.holly.idiocy.org> <20181219160308.GA43504@breton.holly.idiocy.org> <83efadcw3j.fsf@gnu.org> <20181227131105.GA18792@breton.holly.idiocy.org> <834lay6pe4.fsf@gnu.org> <20181228212115.GA59461@breton.holly.idiocy.org> <83pntk6cte.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1546123658 4311 195.159.176.226 (29 Dec 2018 22:47:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2018 22:47:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Alan Third , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 29 23:47:34 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdNOI-0000zw-4V for ged-emacs-devel@m.gmane.org; Sat, 29 Dec 2018 23:47:34 +0100 Original-Received: from localhost ([127.0.0.1]:41950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdNQO-00034j-V6 for ged-emacs-devel@m.gmane.org; Sat, 29 Dec 2018 17:49:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdNQ7-0002iM-Fc for emacs-devel@gnu.org; Sat, 29 Dec 2018 17:49:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdNC8-0001U8-2M for emacs-devel@gnu.org; Sat, 29 Dec 2018 17:35:05 -0500 Original-Received: from eastern.maple.relay.mailchannels.net ([23.83.214.55]:7710) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gdN7H-0000mw-Of; Sat, 29 Dec 2018 17:29:59 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DF7CD683741; Sat, 29 Dec 2018 22:29:57 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a25.g.dreamhost.com (unknown [100.96.19.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9F09D683668; Sat, 29 Dec 2018 22:29:57 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a25.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sat, 29 Dec 2018 22:29:57 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Chemical-Lyrical: 1d41ebd12e48e8d5_1546122597770_3955822054 X-MC-Loop-Signature: 1546122597769:2013984581 X-MC-Ingress-Time: 1546122597769 Original-Received: from pdx1-sub0-mail-a25.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a25.g.dreamhost.com (Postfix) with ESMTP id 45623819B9; Sat, 29 Dec 2018 14:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=GdpaT2 n5jCN1eruJQAQvHQjouGM=; b=BxnFvDqbosnPTnSjVNPk11y9NRuthApdQWilAk vUxZ3q/Y3SZXxay59qNms+MqGOQu44jO/PsIGt+se0U6Zr+v1Oz8kyoegPEC4AR1 xI5EtPzMteJxOXBoYMEk9TbG908r071c+9IXGR/x0bTHtDo9wBxZrkNOtk3UlRB1 ADEq8= Original-Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a25.g.dreamhost.com (Postfix) with ESMTPSA id A29168060B; Sat, 29 Dec 2018 14:29:55 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a25 In-Reply-To: <83pntk6cte.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Dec 2018 08:56:29 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdekgdduieefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgfgsehtkeertddtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.214.55 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232038 Archived-At: >> > This avoids the unnecessary calculations too late, IMO. Since I >> > expect most images to not require resizing, I suggest to make that >> > frequent case as fast as it is today, which means avoid any >> > unnecessary lookups in the image spec. As a minimum, you don't need >> > to look up :max-width and :max-height. Bonus points if you avoid >> > calling this function altogether when the image needs no resizing. >> >> I=E2=80=99m not sure how to check whether the image needs resizing wit= hout >> doing the lookups for :width, :height, :max-width, etc. > > Maybe I'm misreading the code, but it looks to me you only need > :scale, :width, and :height. Am I missing something? It's easier in application code just to set :max-width/:max-height to the window dimensions and let the core to calculate its scale.