all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#40127: 27.0.90; image-mode fails on all images with short EXIF tags
@ 2020-03-18 23:57 Juri Linkov
  2020-03-19 15:19 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2020-03-18 23:57 UTC (permalink / raw)
  To: 40127

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






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#40127: 27.0.90; image-mode fails on all images with short EXIF tags
  2020-03-18 23:57 bug#40127: 27.0.90; image-mode fails on all images with short EXIF tags Juri Linkov
@ 2020-03-19 15:19 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2020-03-19 15:19 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 40127

Juri Linkov <juri@linkov.net> 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-19 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-18 23:57 bug#40127: 27.0.90; image-mode fails on all images with short EXIF tags Juri Linkov
2020-03-19 15:19 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.