Subject: 27.0.90; image-mode fails on all images with short EXIF tags

From: Juri Linkov <[email-masked]>
Date: Thu, 19 Mar 2020 01:57:03 +0200

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))