From unknown Fri Aug 15 15:55:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40127: 27.0.90; image-mode fails on all images with short EXIF tags Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Mar 2020 23:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40127 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 40127@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158457592321247 (code B ref -1); Wed, 18 Mar 2020 23:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2020 23:58:43 +0000 Received: from localhost ([127.0.0.1]:41581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEiaB-0005Wd-DZ for submit@debbugs.gnu.org; Wed, 18 Mar 2020 19:58:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:47758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEia7-0005WU-QL for submit@debbugs.gnu.org; Wed, 18 Mar 2020 19:58:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51227) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEia6-0006pT-JS for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 19:58:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEia5-0007Um-IK for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 19:58:38 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:52303) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jEia5-0007St-CY for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 19:58:37 -0400 X-Originating-IP: 91.129.96.173 Received: from mail.gandi.net (m91-129-96-173.cust.tele2.ee [91.129.96.173]) (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 0130F40003 for ; Wed, 18 Mar 2020 23:58:34 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET Date: Thu, 19 Mar 2020 01:57:03 +0200 Message-ID: <87a74d2p4g.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.183.194 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I realized that the 4th problem reported in bug#39994 is not related to image-converter.el, so here is a separate bug report. The problem is that currently image-mode fails to open all image files where one of EXIF tags is shorter than 4 bytes. So none of the images created by a device whose EXIF tag "Manufacturer" is "HTC" can not be opened in Emacs 27. Here's is the patch that at least allows opening any image ignoring errors in EXIF parser implementation: diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 22d7d91314..10900be33f 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -769,7 +769,7 @@ image-toggle-display-image ;; Get the rotation data from the file, if any. (setq image-transform-rotation (or (exif-orientation - (ignore-error exif-error + (ignore-errors (exif-parse-buffer))) 0.0)) From unknown Fri Aug 15 15:55:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40127: 27.0.90; image-mode fails on all images with short EXIF tags Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Mar 2020 15:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40127 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 40127@debbugs.gnu.org Received: via spool by 40127-submit@debbugs.gnu.org id=B40127.15846311904543 (code B ref 40127); Thu, 19 Mar 2020 15:20:01 +0000 Received: (at 40127) by debbugs.gnu.org; 19 Mar 2020 15:19:50 +0000 Received: from localhost ([127.0.0.1]:43499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEwxZ-0001BC-NO for submit@debbugs.gnu.org; Thu, 19 Mar 2020 11:19:49 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEwxV-0001Aq-JZ for 40127@debbugs.gnu.org; Thu, 19 Mar 2020 11:19:48 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEwxM-0007fV-Ou; Thu, 19 Mar 2020 16:19:39 +0100 From: Lars Ingebrigtsen References: <87a74d2p4g.fsf@mail.linkov.net> Date: Thu, 19 Mar 2020 16:19:35 +0100 In-Reply-To: <87a74d2p4g.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 19 Mar 2020 01:57:03 +0200") Message-ID: <878sjwwewo.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > I realized that the 4th problem reported in bug#39994 is not related to > image-converter.el, so here is a separate bug report. > > The problem is that currently image-mode fails to open all image f [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: ingebrigtsen.no] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > I realized that the 4th problem reported in bug#39994 is not related to > image-converter.el, so here is a separate bug report. > > The problem is that currently image-mode fails to open all image files > where one of EXIF tags is shorter than 4 bytes. So none of the > images created by a device whose EXIF tag "Manufacturer" is "HTC" > can not be opened in Emacs 27. OK, fixed now in Emacs 27. (Well, I did the fix on the trunk and then cherry-picked it... I was slightly unsure whether to also include the new test cases and files, but I did so anyway -- they won't affect the release anyway, I think?) > Here's is the patch that at least allows opening any image > ignoring errors in EXIF parser implementation: [...] > - (ignore-error exif-error > + (ignore-errors > (exif-parse-buffer))) No, we should never wallpaper over bugs in the code -- we should fix the bugs. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 19 11:19:54 2020 Received: (at control) by debbugs.gnu.org; 19 Mar 2020 15:19:54 +0000 Received: from localhost ([127.0.0.1]:43502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEwxd-0001BZ-WA for submit@debbugs.gnu.org; Thu, 19 Mar 2020 11:19:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEwxc-0001B4-CT for control@debbugs.gnu.org; Thu, 19 Mar 2020 11:19:52 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEwxU-0007fg-Ro for control@debbugs.gnu.org; Thu, 19 Mar 2020 16:19:46 +0100 Date: Thu, 19 Mar 2020 16:19:44 +0100 Message-Id: <877dzgwewf.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40127 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 40127 fixed close 40127 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 40127 fixed close 40127 27.1 quit