From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: chrisl@cs.cmu.edu Newsgroups: gmane.emacs.bugs Subject: patch for image.el Date: Thu, 29 Jan 2004 16:20:40 -0500 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <16409.31016.42635.544342@ux11.sp.cs.cmu.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1075411368 22553 80.91.224.253 (29 Jan 2004 21:22:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Jan 2004 21:22:48 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 29 22:22:43 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AmJcZ-0007rM-00 for ; Thu, 29 Jan 2004 22:22:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AmJbf-0001Vc-Ay for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jan 2004 16:21:47 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AmJbN-0001ON-Dd for bug-gnu-emacs@gnu.org; Thu, 29 Jan 2004 16:21:29 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AmJan-0001E2-4w for bug-gnu-emacs@gnu.org; Thu, 29 Jan 2004 16:21:24 -0500 Original-Received: from [128.2.198.38] (helo=ux11.sp.cs.cmu.edu) by monty-python.gnu.org with smtp (Exim 4.24) id 1AmJam-0001Dw-SX for bug-gnu-emacs@gnu.org; Thu, 29 Jan 2004 16:20:52 -0500 Original-To: bug-gnu-emacs@gnu.org X-Mailer: VM 6.92 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6815 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6815 Hi, I'm using GNU emacs 21.3.1 under Linux. I discovered that image.el didn't recognize some of my jpeg files (it reported them as not being image files). By using file(1) and looking at the magic(5) file, I saw that there is a different jpeg format in addition to JFIF: Exif. I also found that image-jpeg-p can cause substring to run past the end of the data array, which causes an error. I made the following change that fixes both problems: 67,69c67 < (string-match "JFIF\\|Exif" < (substring data i < (min (+ i nbytes) len))))) --- > (string-match "JFIF" (substring data i (+ i nbytes))))) Thanks for maintaining The One True Editor. :) - Chris