From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Unicode handling breaks Jpeg image detection? Date: Tue, 24 Jun 2008 16:23:32 -0400 Message-ID: <87od5qbn0b.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1214339312 22379 80.91.229.12 (24 Jun 2008 20:28:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Jun 2008 20:28:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 24 22:29:17 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KBF8e-0005xu-O8 for ged-emacs-devel@m.gmane.org; Tue, 24 Jun 2008 22:29:16 +0200 Original-Received: from localhost ([127.0.0.1]:60914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KBF7p-0003AJ-7M for ged-emacs-devel@m.gmane.org; Tue, 24 Jun 2008 16:28:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KBF7k-00039k-KN for emacs-devel@gnu.org; Tue, 24 Jun 2008 16:28:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KBF7j-00038Y-AQ for emacs-devel@gnu.org; Tue, 24 Jun 2008 16:28:20 -0400 Original-Received: from [199.232.76.173] (port=34994 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KBF7j-00038P-28 for emacs-devel@gnu.org; Tue, 24 Jun 2008 16:28:19 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:34902) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KBF7i-0003KJ-QJ for emacs-devel@gnu.org; Tue, 24 Jun 2008 16:28:18 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id A05CF4E45E; Tue, 24 Jun 2008 16:23:32 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99867 Archived-At: In Emacs 23, jpeg content autodetection seems to be broken. I think this may be an encoding issue. To see this, rename any jpeg image from foo.jpg to foo.JPG (to turn off file-name detection), and open it in Emacs. Emacs 23 fails to detect the image, while Emacs 22 works. In a buffer containing the exact same jpeg data, do M-: (string-match "\\`\xff\xd8" (buffer-string)) RET This gives 0 in Emacs 22, and nil in Emacs 23. This is the check that makes image-type-header-regexps and image-jpeg-p fail for Emacs 23. Could someone try to fix this?