From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: image-size Date: Thu, 20 Jun 2013 21:52:29 +0200 Message-ID: References: <837ghopy8a.fsf@gnu.org> <83zjukog7h.fsf@gnu.org> <83txksodgv.fsf@gnu.org> <83r4fwocqd.fsf@gnu.org> <83ppvgoaw9.fsf@gnu.org> <83mwqko9ge.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371757977 19024 80.91.229.3 (20 Jun 2013 19:52:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Jun 2013 19:52:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 20 21:52:58 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Upkue-0008FA-92 for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 21:52:56 +0200 Original-Received: from localhost ([::1]:38225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upkud-00027r-Tk for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 15:52:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpkuW-0001xO-8Y for emacs-devel@gnu.org; Thu, 20 Jun 2013 15:52:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpkuQ-0006sV-MJ for emacs-devel@gnu.org; Thu, 20 Jun 2013 15:52:48 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:50139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpkuQ-0006rh-7B; Thu, 20 Jun 2013 15:52:42 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UpkuD-0005Yi-JH; Thu, 20 Jun 2013 21:52:29 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVwQ1Pt6dfc1Mu4npz9 /elEDhZreGC7AAACTElEQVQ4jV2US5LjIAyGFdPeB/ABDLj3IMX7YDN7T6W4/1VGEunpnlGlEkof egC/Au2nHRt/WV3C+RPQR0MPrS0MzE+QszFIGTM2+CfVlCfwNF9EDYINUWxLRIQYU4pIyKmWyjtr q9bm3ruxYjE1SXXOJptgHfv7xb8cPsAunpddFZRvcHb1+P4/0J29J/VzL0oE7APgLOBdfIALgH1F AARpb3RV54nyDBpxGb4LK8kYHPMtEdA8zR30fhgkBZ0oE81lZ/BQ4LOc/GRAKc1FIha5BZtBQN0J tyNJuwbbALKA5pMhD3DnjpfxWoDaritcjvDZr1w0YjVWwOY0wSZAHy1BUfBRaWlLXZ79leFhawKz 1TDAVpejnZfhc1DIwBEDpM220A6CLwsaUar3MLFs1i8/Ba2B1i0+cKP5C5gBbodd2sHdrPl6g9HV b8dvIx3f5/4aZLLJcqoUQpUj/7qu628q1pVxbmucrT07vEad4CIr8SVv6fmFzjcwuThkcIkUM9By wsiELjgsDUCukOWJR38ZTcRPS5MAxysmsQODWXQSERrkB5cgMqQy6VAUcI2VAantQ4kiK0wNfDk8 EqsyaYRRJaJpELnrKCAouFCGpXgGcYAY929wOxvwBIkx3VWkCjSVGEdg/NQaEpzoMUDifYSfQ/Wy T9qNyMOZ5HPXGob9dCMBkgbjigr6xH66HQ1kiOXgmfIYNjmrSJQwLkecYtS5HiZLcM21LQaefP9I NXv+uzBT03FmzNtt5pRrIoPZPAYQ5b7TyD9Sjbr8A+7PyN6xWNvaAAAAAElFTkSuQmCC X-Now-Playing: David Bowie's _Scary Monsters_: "Fashion" X-Hashcash: 1:23:130620:emacs-devel@gnu.org::V2F8/+BU6zSv9ZdT:000000000000000000000000000000000000000000FWRq X-Hashcash: 1:23:130620:eliz@gnu.org::B4ugDyk9AcHE/WUw:00001FBtA In-Reply-To: <83mwqko9ge.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 20 Jun 2013 22:42:25 +0300") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1UpkuD-0005Yi-JH MailScanner-NULL-Check: 1372362750.15343@EoVM2eZoKuAO8ESBqP0TeA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160774 Archived-At: Eli Zaretskii writes: > Is this using imagemagick or using libjpeg? imagemagick. > If the former, perhaps imagemagick is the only library that needs your > "fast path". The other image libraries don't, as they clearly don't > write to X (otherwise I couldn't have used them on Windows). I can't see anything in the imagemagick code that talks to X, so I think it's a general Emacs image thingie. Anybody? Anyway, this has led me to consider this a bit more. Sure, this is faster than 46 seconds: (benchmark-elapse (image-size (create-image "/home/larsi/Catalogue/html/scans/BAD0013/BAD0013-1-l.jpg") t)) => 0.226372938 But on the other hand, the next time we open the file to scale it down, we'll have to decode the image yet again, which will take 0.23 seconds once again. Wouldn't it be nice if we could just pass in :max-width and :max-height to `create-image', and `put-image' would then respect this when actually creating the image? Then the image would only have to be decoded once, and we'd have the best of both worlds. All other uses of `image-size' that I can see in shr are for images that are or will definitely be inserted, so they'll already have been (or will be) transferred over X. So it fits my use case, and will make displaying sensibly-sized images fast and convenient in general. (If you have imagemagick, that is. Most of the other image renderers don't support resizing, and ignore :width and :height, so they should also ignore :max-width and :max-height.) Opinions? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/