GNU bug report logs - #24317
25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Sat, 27 Aug 2016 08:05:01 UTC

Severity: minor

Found in version 25.1.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24317: closed (25.1.50; image-dired-rotate-original: regexp
 doesn't match .jpeg suffix)
Date: Sun, 04 Sep 2016 02:20:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 4 Sep 2016 11:19:01 +0900 (JST)
with message-id <alpine.DEB.2.20.1609041116100.3814 <at> calancha-pc>
and subject line Re: bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
has caused the debbugs.gnu.org bug report #24317,
regarding 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24317: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24317
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg
 suffix
Date: Sat, 27 Aug 2016 17:04:01 +0900 (JST)
emacs -Q:

;; file: full name of a .jpeg file in your filesystem
(let ((file "/tmp/bug24317.jpeg"))
  (require 'dired)
  (require 'image-dired)
  (dired file)
  (image-dired-display-thumbs)
  (image-dired-rotate-original 90))
;; if: Only JPEG images can be rotated!


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 4ea0333150937d3f2f615df1ed476e6279caf77b Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sat, 27 Aug 2016 16:53:37 +0900
Subject: [PATCH] image-dired-rotate-original: regexp doesn't match .jpeg
 suffix

* lisp/image-dired.el (image-dired-jpeg-suffix-regexp): New defvar.
(image-dired-rotate-original, image-dired-get-exif-file-name):
Use it (Bug#24317).
---
 lisp/image-dired.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 67b023d..bb43a55 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1906,13 +1906,16 @@ image-dired-refresh-thumb
     (clear-image-cache)
     (image-dired-create-thumb file (image-dired-thumb-name file))))

+(defvar image-dired-jpeg-suffix-regexp "\\.[Jj][Pp][Ee]?[Gg]$"
+  "Regexp to match JPEG file extensions.")
+
 (defun image-dired-rotate-original (degrees)
   "Rotate original image DEGREES degrees."
   (if (not (image-dired-image-at-point-p))
       (message "No image at point")
     (let ((file (image-dired-original-file-name))
           command)
-      (if (not (string-match "\\.[jJ][pP[eE]?[gG]$" file))
+      (if (not (string-match image-dired-jpeg-suffix-regexp file))
           (error "Only JPEG images can be rotated!"))
       (setq command (format-spec
                      image-dired-cmd-rotate-original-options
@@ -1952,7 +1955,8 @@ image-dired-get-exif-file-name
 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)))
+    (if (not (string-match image-dired-jpeg-suffix-regexp
+                           (expand-file-name file)))
         (progn
           (setq no-exif-data-found t)
           (setq data
-- 
2.9.3


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.9)
 of 2016-08-26 built on calancha-pc
Repository revision: 1c7166a3ba399efbefc65feb8a6a41ef0dfa33a4



[Message part 3 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24317-done <at> debbugs.gnu.org
Subject: Re: bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't
 match .jpeg suffix
Date: Sun, 4 Sep 2016 11:19:01 +0900 (JST)

On Sun, 28 Aug 2016, Eli Zaretskii wrote:

> Thanks, this looks good to me.  Please push in a few days if no
> additional comments are posted.

Fixed in master branch.


This bug report was last modified 8 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.