summaryrefslogtreecommitdiff
path: root/lisp/image-dired.el
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2016-09-04 11:09:31 +0900
committerTino Calancha <tino.calancha@gmail.com>2016-09-04 11:09:31 +0900
commit2db3307e8a966a8f652a210d8f8eb83daddd7d9f (patch)
tree053f5bbe8b3be9c893b3267e519fd9cc91fe0191 /lisp/image-dired.el
parent7c16c89c5772a1777e4d73ebc5ea2a3ff8344c22 (diff)
downloademacs-2db3307e8a966a8f652a210d8f8eb83daddd7d9f.tar.gz
emacs-2db3307e8a966a8f652a210d8f8eb83daddd7d9f.tar.bz2
emacs-2db3307e8a966a8f652a210d8f8eb83daddd7d9f.zip
image-type-from-file-name: Perform a case insensitive match
Fix Bug#24317 * lisp/image.el (image-type-from-file-name): Bind case-fold-search to a non-nil value to force a case insensitive match. * lisp/image-dired.el (image-dired-rotate-original): Use image-type (Bug#24317). (image-dired-get-exif-file-name): Idem. Set 'no-exif-data-found' and 'data' in same setq call. Use file-attribute-modification-time.
Diffstat (limited to 'lisp/image-dired.el')
-rw-r--r--lisp/image-dired.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 67b023dfd70..34e4eaefbc1 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1912,8 +1912,8 @@ overwritten. This confirmation can be turned off using
(message "No image at point")
(let ((file (image-dired-original-file-name))
command)
- (if (not (string-match "\\.[jJ][pP[eE]?[gG]$" file))
- (error "Only JPEG images can be rotated!"))
+ (unless (eq 'jpeg (image-type file))
+ (error "Only JPEG images can be rotated!"))
(setq command (format-spec
image-dired-cmd-rotate-original-options
(list
@@ -1952,15 +1952,14 @@ for traceability. The format of the returned file name is
YYYY_MM_DD_HH_MM_DD_ORIG_FILE_NAME.jpg. Used from
`image-dired-copy-with-exif-file-name'."
(let (data no-exif-data-found)
- (if (not (string-match "\\.[Jj][Pp][Ee]?[Gg]$" (expand-file-name file)))
- (progn
- (setq no-exif-data-found t)
- (setq data
- (format-time-string
- "%Y:%m:%d %H:%M:%S"
- (nth 5 (file-attributes (expand-file-name file))))))
+ (if (not (eq 'jpeg (image-type (expand-file-name file))))
+ (setq no-exif-data-found t
+ data (format-time-string
+ "%Y:%m:%d %H:%M:%S"
+ (file-attribute-modification-time
+ (file-attributes (expand-file-name file)))))
(setq data (image-dired-get-exif-data (expand-file-name file)
- "DateTimeOriginal")))
+ "DateTimeOriginal")))
(while (string-match "[ :]" data)
(setq data (replace-match "_" nil nil data)))
(format "%s%s%s" data