diff options
author | Eli Zaretskii <eliz@gnu.org> | 2021-02-16 18:20:06 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-02-16 18:20:06 +0200 |
commit | c977370dd734be12ffbaf0da2f3db529d6175b62 (patch) | |
tree | 784bcbbaf35743872e1c31b822e97ab228c337d3 /lisp/image-mode.el | |
parent | da64a257a482e95a3a314da97260ea08635a83e0 (diff) | |
download | emacs-c977370dd734be12ffbaf0da2f3db529d6175b62.tar.gz |
Avoid point movement when visiting image files
* lisp/image-mode.el (image-toggle-display-image): Preserve point
around the call to exif-parse-buffer, to prevent it from moving
into the image data. (Bug#46552)
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r-- | lisp/image-mode.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index aee91ee8b21..24be008f3f7 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -829,7 +829,9 @@ was inserted." (setq image-transform-rotation (or (exif-orientation (ignore-error exif-error - (exif-parse-buffer))) + ;; exif-parse-buffer can move point, so preserve it. + (save-excursion + (exif-parse-buffer)))) 0.0))) ;; Swap width and height when changing orientation ;; between portrait and landscape. |