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 22:57:10 +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> <83k3loo66g.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371761851 26615 80.91.229.3 (20 Jun 2013 20:57:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Jun 2013 20:57:31 +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 22:57:32 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 1Uplv9-0002o9-He for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 22:57:31 +0200 Original-Received: from localhost ([::1]:60950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uplv8-00042N-Ul for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 16:57:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uplv3-0003tF-0d for emacs-devel@gnu.org; Thu, 20 Jun 2013 16:57:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uplv0-000484-BZ for emacs-devel@gnu.org; Thu, 20 Jun 2013 16:57:24 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:39946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uplv0-00047x-5e; Thu, 20 Jun 2013 16:57:22 -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 1Upluo-0006vb-I0; Thu, 20 Jun 2013 22:57:10 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXbxcXq3d3Ojo/////+ //63DxD+/v36+PnlTC3CAAACUElEQVQ4jW2UQXPaMBCFVyHgqxy35uqYMVzjKCNfQ52ZXoNntlxt 3JCriYf47/ethIG22WGMpE9aPe2uRK352ujceg/D8PN/8K4JgNTnP+Cd5vvfxtgDxX+BguLS93/q +ApYPR/ORv0F1MGUz9YE5QgKtb+M86SLRlDHj/w5DAdewVO2LVTpwZNqjxWaP3iD77Equ96DZmay X2h+5wpheOCoCDzo2pwnkMb3fIsRXljdCrCBeRNPmOoXvpbPkYD81ky9c/ww9ZHbYiag7gtewFO2 xRi2lZ4SoEvXz7GB5aWf0bUACl6d2Ibmo8+6N2RnVva00ypVNzcnwXlkqJihIWKrROuUZ+JrWUwM 5dGb15LokDT8O8EAD9F06xxrRYru5EQ77gOAQaSYLFGkwbzg5Rxg58UmpAPSJEd6yrYhwFHE7iqA G4BMBL9VAnay9/QVIEs0pdzK7gIOCG3BK4A7rekePQRAQIzzPfKQKKhSNIHgmqNAzoGYHitLpBVW +J6cI59AFhZ9iNyEEJAYaZ+4WEnqXtapIkpXL3te8WyNWJnAoqhSMXUn34y5rQWECIEzNya2MbXk Q2qhSq8MIQpdziPrYjoasoD6AEAVuXobDXpzVyVGty7po0nKewfqyEpMT4bis8pXIny5IvCGsnqO T9Xe9Tvev+y9TTdPUqH+fgRrvohdoMjHG9XF2eXiDEoWWPJ38+O8ItHfzBmYRo0PRNkFp3vs+wfl T2K1cn+4+KeZDak5Xg3y8409A2NDIlJjBAC+fn32DV09OLb1s+Schz/tT/N8nSlsJwAAAABJRU5E rkJggg== X-Now-Playing: Actress's _Paint, Straw and Bubbles_: "Maze (Long Version)" X-Hashcash: 1:23:130620:eliz@gnu.org::5VE7C/r7Hp9GkD4T:000004PSc X-Hashcash: 1:23:130620:emacs-devel@gnu.org::RCm6xlRfleM1cBY0:000000000000000000000000000000000000000000g513 In-Reply-To: <83k3loo66g.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 20 Jun 2013 23:53:11 +0300") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1Upluo-0006vb-I0 MailScanner-NULL-Check: 1372366630.76193@pQ5IItIM3QJp8yKBD16KTA 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:160787 Archived-At: Eli Zaretskii writes: >> I can't see anything in the imagemagick code that talks to X, so I think >> it's a general Emacs image thingie. > > IT CANNOT BE TRUE!!!! IF IT WERE TRUE, I COULD NOT HAVE USED IMAGES > ON WINDOWS, where there's no X. Of course there is no X stuff on Windows. But if you're running over X, lookup_image pushes data over X, for some reason or other. I have no idea what the reason might be, but perhaps somebody else does. >> 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. > > If it is in the cache, Emacs will fetch it from there. It would decode twice with the two-part `image-size'/`put-image' code, since `image-size' would then not put things into the cache. As Chong said: > You have to replace the call to lookup_image in `image-size' with a > new function that avoids loading the image. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/