From xah@xahlee.org Thu Dec 25 10:19:51 2008 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Dec 2008 18:19:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBPIJmpn001005 for ; Thu, 25 Dec 2008 10:19:49 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFuoF-0006zQ-IL for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2008 13:19:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFuoE-0006zE-QB for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2008 13:19:47 -0500 Received: from [199.232.76.173] (port=43137 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFuoE-0006zB-MS for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2008 13:19:46 -0500 Received: from mout.perfora.net ([74.208.4.194]:56645) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LFuoE-00087Q-9w for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2008 13:19:46 -0500 Received: from [192.168.1.2] (c-76-102-50-240.hsd1.ca.comcast.net [76.102.50.240]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1LFuo01uVx-0007H7; Thu, 25 Dec 2008 13:19:33 -0500 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: quoted-printable Message-Id: Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed To: bug-gnu-emacs@gnu.org From: xah lee Subject: problem computing image dimension of huge jpeg file Date: Thu, 25 Dec 2008 10:19:29 -0800 X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX18O4243tQeiOByLLtahE6i63Q8dBWq3iF/hSsK RKTCsqRtQ6r+04X/3T+bBac7rfajkYuIh3DDt5cMKqGTn1Oh2w z+wTuRKU9mc5ZRmn7QqaQ== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. this appears to be a bug. Summary: emacs seems to have some limitation when trying to compute a =20= jpeg image's width and height when the image is huge. Sorry i haven't had time to narrow down exactly where is the bug, but =20= here's a short description with my elisp code that this problem happens. When using the following code full-size-img-linkify (see code below) =20 on a large image that is 4248x544, but emacs report it as 30x30. This has happened to me once before on another image. When i try to =20 open the image in emacs, emacs doesn't display it. So, the problem =20 may simply be that emacs can't properly decode the file. (as far as i =20= know, the image is not corrupt since i can view it in 2 other image =20 viewer programs) Here's steps to reproduce: =E2=80=A2 download the image here: wget -U "Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.0.4) =20 Gecko/2008102920 Firefox/3.0.4" http://xahlee.org/Whirlwheel_dir/=20 livermore/livermore.jpg (the image is available here http://xahlee.org/Whirlwheel_dir/=20 livermore.html but if you use wget you need to give mozilla agent =20 string) =E2=80=A2 save the image to disk in a directory, let's say named xxx. =E2=80=A2 create a html file in the dir xxx, say call it test.html =E2=80=A2 insert the text =E2=80=9Clivermore.jpg=E2=80=9D (without the = quotes) into the =20 file, then press return. =E2=80=A2 now move cursor to the line. Then M-x full-size-img-linkify. Emacs should change the line to this: =E2=9D=90 but what's expected is this: =E2=9D=90= In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0) of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp Windowing system distributor `Apple Inc.', version 10.4.11 pasted below is the function (defun full-size-img-linkify () "Make img file path at cursor point into a img link. Example: i/goddesses.jpg becomes =E2=9D=90 If region is active, use region as file name. " (interactive) (let (imgPath imgfName linkText bds imgDimen width height myResult) (setq bds (if (and transient-mark-mode mark-active) (cons (region-beginning) (region-end)) (bounds-of-thing-at-point 'filename) )) (setq imgPath (buffer-substring-no-properties (car bds) (cdr bds)) ) (setq imgfName (file-name-nondirectory imgPath)) ;; (setq linkText ;; (if (< (length imgfName) 20) ;; imgfName ;; (concat (substring imgfName 0 5) "..." (substring =20 imgfName -6) ) )) (setq imgDimen (get-image-dimensions imgPath)) (setq width (number-to-string (car imgDimen))) (setq height (number-to-string (car (last imgDimen)))) (setq myResult (concat "=E2=9D=90")) (delete-region (car bds) (cdr bds)) (insert myResult) )) Xah =E2=88=91 http://xahlee.org/ =E2=98=84 From schwab@suse.de Fri Dec 26 09:05:15 2008 Received: (at submit) by emacsbugs.donarmstrong.com; 26 Dec 2008 17:05:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBQH5BIr019006 for ; Fri, 26 Dec 2008 09:05:13 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LGG7b-0001XI-Id for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2008 12:05:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LGG7Z-0001WH-Mv for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2008 12:05:11 -0500 Received: from [199.232.76.173] (port=58418 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LGG7Z-0001WC-GN for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2008 12:05:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:56097) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LGG7Y-0001rT-SA for bug-gnu-emacs@gnu.org; Fri, 26 Dec 2008 12:05:09 -0500 Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 929CE46641; Fri, 26 Dec 2008 18:05:02 +0100 (CET) From: Andreas Schwab To: xah lee Cc: 1701@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#1701: problem computing image dimension of huge jpeg file References: X-Yow: Yow! Am I cleansed yet?! Date: Fri, 26 Dec 2008 18:04:59 +0100 In-Reply-To: (xah lee's message of "Thu, 25 Dec 2008 10:19:29 -0800") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 xah lee writes: > When using the following code full-size-img-linkify (see code below) on= a > large image that is 4248x544, but emacs report it as 30x30. You should report that to the author of the get-image-dimensions function. Andreas. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different." From cyd@stupidchicken.com Sat Dec 27 06:25:07 2008 Received: (at control) by emacsbugs.donarmstrong.com; 27 Dec 2008 14:25:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBREP4HR025755 for ; Sat, 27 Dec 2008 06:25:05 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 400C557E204; Sat, 27 Dec 2008 09:25:13 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 1701 Date: Sat, 27 Dec 2008 09:25:13 -0500 Message-ID: <871vvtitkm.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii close 1701 thanks From unknown Fri Sep 05 19:41:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sat, 24 Jan 2009 15:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator