From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Willem Rein Oudshoorn Newsgroups: gmane.emacs.devel Subject: Re: image-size Date: Fri, 21 Jun 2013 17:54:12 +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> <83fvwcng84.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371830080 10161 80.91.229.3 (21 Jun 2013 15:54:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Jun 2013 15:54:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 21 17:54:40 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 1Uq3fa-0007x0-SR for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 17:54:38 +0200 Original-Received: from localhost ([::1]:53152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq3fa-0001MH-Go for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 11:54:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq3fS-00019b-Fa for emacs-devel@gnu.org; Fri, 21 Jun 2013 11:54:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uq3fN-0006Xb-UF for emacs-devel@gnu.org; Fri, 21 Jun 2013 11:54:30 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq3fN-0006XE-Mu for emacs-devel@gnu.org; Fri, 21 Jun 2013 11:54:25 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uq3fL-0007dz-PQ for emacs-devel@gnu.org; Fri, 21 Jun 2013 17:54:23 +0200 Original-Received: from ironhead.xs4all.nl ([80.101.115.122]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Jun 2013 17:54:23 +0200 Original-Received: from woudshoo by ironhead.xs4all.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Jun 2013 17:54:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ironhead.xs4all.nl User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:OK5t9LQcnRD5DxtZNctMeNRTW+0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:160841 Archived-At: Eli Zaretskii writes: >> From: Lars Magne Ingebrigtsen >> Date: Thu, 20 Jun 2013 22:57:10 +0200 >> Cc: emacs-devel@gnu.org >> >> As Chong said: >> >> > You have to replace the call to lookup_image in `image-size' with a >> > new function that avoids loading the image. > > What do you mean by "loading the image"? You cannot have the size > without reading the image file. Well, I do not know for jpeg etc. But the png file format has the image size in pixels right at the start of the file, so you only need to read in a tiny part of the file. For png the width is big-endian integer starting at byte 16, and the height starts at 20. Wim Oudshoorn.