unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
@ 2016-08-27  8:04 Tino Calancha
  2016-08-27  8:21 ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2016-08-27  8:04 UTC (permalink / raw)
  To: 24317


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






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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  8:04 bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix Tino Calancha
@ 2016-08-27  8:21 ` Eli Zaretskii
  2016-08-27  8:53   ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2016-08-27  8:21 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 24317

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sat, 27 Aug 2016 17:04:01 +0900 (JST)
> 
> >From 4ea0333150937d3f2f615df1ed476e6279caf77b Mon Sep 17 00:00:00 2001
> From: Tino Calancha <tino.calancha@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).

I understand why we need to fix a typo in the regexp (which the log
entry doesn't even mention, btw), but what's the rationale for making
it a defvar?

Thanks.





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  8:21 ` Eli Zaretskii
@ 2016-08-27  8:53   ` Tino Calancha
  2016-08-27  8:57     ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2016-08-27  8:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24317, Tino Calancha



> I understand why we need to fix a typo in the regexp (which the log
> entry doesn't even mention, btw), but what's the rationale for making
> it a defvar?
I made a defvar because it was used in 2 functions: only one show the 
typo.
Do you prefer just the simple 1-line fix? (ie., just correct the typo)





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  8:53   ` Tino Calancha
@ 2016-08-27  8:57     ` Eli Zaretskii
  2016-08-27  9:21       ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2016-08-27  8:57 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 24317

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sat, 27 Aug 2016 17:53:49 +0900 (JST)
> cc: Tino Calancha <tino.calancha@gmail.com>, 24317@debbugs.gnu.org
> 
> > I understand why we need to fix a typo in the regexp (which the log
> > entry doesn't even mention, btw), but what's the rationale for making
> > it a defvar?
> I made a defvar because it was used in 2 functions: only one show the 
> typo.

In that case, why not make a function that does the string-match as
well, in which case you won't need a variable, because it will appear
in a single place, and will also have the test localized to a single
function?

Thanks.





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  8:57     ` Eli Zaretskii
@ 2016-08-27  9:21       ` Tino Calancha
  2016-08-27  9:27         ` Tino Calancha
  2016-08-27  9:42         ` Thien-Thi Nguyen
  0 siblings, 2 replies; 15+ messages in thread
From: Tino Calancha @ 2016-08-27  9:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24317, Tino Calancha



> In that case, why not make a function that does the string-match as
> well, in which case you won't need a variable, because it will appear
> in a single place, and will also have the test localized to a single
> function?
>
> Thanks.
I see.  Its good idea.
I have choose a defsubst because it is small function.  I am not sure
if it is recommended or if people prefers always defun's.
Please, et me know if the doc string reads weird and need some tunning

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 0be47e3968d898bf8f44e5c37f9035be3147a4a2 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Sat, 27 Aug 2016 18:16:25 +0900
Subject: [PATCH] image-dired-rotate-original: Fix regexp typo

* lisp/image-dired.el (image-dired-jpeg-file-p): New defsubst;
Return non-nil if a file has a JPEG extension.
(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..7c8d43b 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1205,6 +1205,10 @@ image-dired-dired-file-marked-p
      (beginning-of-line)
      (not (looking-at "^ .*$"))))

+(defsubst image-dired-jpeg-file-p (file)
+  "Return non-nil if FILE has a JPEG extension."
+  (string-match-p "\\.[Jj][Pp][Ee]?[Gg]$" (expand-file-name file)))
+
  (defun image-dired-modify-mark-on-thumb-original-file (command)
    "Modify mark in dired buffer.
  COMMAND is one of `mark' for marking file in dired, `unmark' for
@@ -1912,7 +1916,7 @@ image-dired-rotate-original
        (message "No image at point")
      (let ((file (image-dired-original-file-name))
            command)
-      (if (not (string-match "\\.[jJ][pP[eE]?[gG]$" file))
+      (if (not (image-dired-jpeg-file-p file))
            (error "Only JPEG images can be rotated!"))
        (setq command (format-spec
                       image-dired-cmd-rotate-original-options
@@ -1952,7 +1956,7 @@ 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 (image-dired-jpeg-file-p file)))
          (progn
            (setq no-exif-data-found t)
            (setq data
-- 
2.9.3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;






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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  9:21       ` Tino Calancha
@ 2016-08-27  9:27         ` Tino Calancha
  2016-08-27  9:42         ` Thien-Thi Nguyen
  1 sibling, 0 replies; 15+ messages in thread
From: Tino Calancha @ 2016-08-27  9:27 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 24317



On Sat, 27 Aug 2016, Tino Calancha wrote:

> -    (if (not (string-match "\\.[Jj][Pp][Ee]?[Gg]$" (expand-file-name file)))
> +    (if (not (image-dired-jpeg-file-p file)))
I added one extra paren, it should read of course:
-    (if (not (string-match "\\.[Jj][Pp][Ee]?[Gg]$" (expand-file-name file)))
+    (if (not (image-dired-jpeg-file-p file))
Sorry for that.






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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  9:21       ` Tino Calancha
  2016-08-27  9:27         ` Tino Calancha
@ 2016-08-27  9:42         ` Thien-Thi Nguyen
  2016-08-27 11:28           ` Eli Zaretskii
  1 sibling, 1 reply; 15+ messages in thread
From: Thien-Thi Nguyen @ 2016-08-27  9:42 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 24317

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

() Tino Calancha <tino.calancha@gmail.com>
() Sat, 27 Aug 2016 18:21:25 +0900 (JST)

   I see.  Its good idea.

Another idea is to use function ‘image-type’,
which can handle a filename as its SOURCE argument.

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (type via)
   (case type
     (technical (eq 'mailing-list via))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27  9:42         ` Thien-Thi Nguyen
@ 2016-08-27 11:28           ` Eli Zaretskii
  2016-08-27 12:18             ` Tino Calancha
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2016-08-27 11:28 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 24317, tino.calancha

> From: Thien-Thi Nguyen <ttn@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  24317@debbugs.gnu.org
> Date: Sat, 27 Aug 2016 11:42:31 +0200
> 
> Another idea is to use function ‘image-type’,
> which can handle a filename as its SOURCE argument.

That is better, yes.  Except that

  (let ((case-fold-search)) (image-type-from-file-name "foo.JPEG"))
    => nil

So I guess that function needs a minor change to be more robust.





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27 11:28           ` Eli Zaretskii
@ 2016-08-27 12:18             ` Tino Calancha
  2016-08-27 12:55               ` Eli Zaretskii
  2016-08-28  6:22               ` Andreas Schwab
  0 siblings, 2 replies; 15+ messages in thread
From: Tino Calancha @ 2016-08-27 12:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Thien-Thi Nguyen, 24317, tino.calancha

[-- Attachment #1: Type: text/plain, Size: 2827 bytes --]



On Sat, 27 Aug 2016, Eli Zaretskii wrote:

>> From: Thien-Thi Nguyen <ttn@gnu.org>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  24317@debbugs.gnu.org
>> Date: Sat, 27 Aug 2016 11:42:31 +0200
>>
>> Another idea is to use function ‘image-type’,
>> which can handle a filename as its SOURCE argument.
>
> That is better, yes.  Except that
>
>  (let ((case-fold-search)) (image-type-from-file-name "foo.JPEG"))
>    => nil
>
> So I guess that function needs a minor change to be more robust.
That's right.  It wuld be worth take a look on 
'image-type-from-file-name'.

I have corrected previous patch.  I drop expand-file-name from
'image-dired-jpeg-file-p'.  I also corrected the extra paren mentioned
before.
If people is happy with it i will apply this patch.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 9d95e361e45df393feaf3f6c451878e794c924eb Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Sat, 27 Aug 2016 18:41:44 +0900
Subject: [PATCH] image-dired-rotate-original: Fix regexp typo

* lisp/image-dired.el (image-dired-jpeg-file-p): New defsubst;
Return non-nil if a file has a JPEG extension.
(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..61b0751 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1205,6 +1205,10 @@ image-dired-dired-file-marked-p
      (beginning-of-line)
      (not (looking-at "^ .*$"))))

+(defsubst image-dired-jpeg-file-p (file)
+  "Return non-nil if FILE has a JPEG extension."
+  (string-match-p "\\.[Jj][Pp][Ee]?[Gg]$" file))
+
  (defun image-dired-modify-mark-on-thumb-original-file (command)
    "Modify mark in dired buffer.
  COMMAND is one of `mark' for marking file in dired, `unmark' for
@@ -1912,7 +1916,7 @@ image-dired-rotate-original
        (message "No image at point")
      (let ((file (image-dired-original-file-name))
            command)
-      (if (not (string-match "\\.[jJ][pP[eE]?[gG]$" file))
+      (if (not (image-dired-jpeg-file-p file))
            (error "Only JPEG images can be rotated!"))
        (setq command (format-spec
                       image-dired-cmd-rotate-original-options
@@ -1952,7 +1956,7 @@ 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 (image-dired-jpeg-file-p (expand-file-name file)))
          (progn
            (setq no-exif-data-found t)
            (setq data
-- 
2.9.3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27 12:18             ` Tino Calancha
@ 2016-08-27 12:55               ` Eli Zaretskii
  2016-08-28 12:26                 ` Tino Calancha
  2016-08-28  6:22               ` Andreas Schwab
  1 sibling, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2016-08-27 12:55 UTC (permalink / raw)
  To: Tino Calancha; +Cc: ttn, 24317

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sat, 27 Aug 2016 21:18:37 +0900 (JST)
> cc: Thien-Thi Nguyen <ttn@gnu.org>, tino.calancha@gmail.com, 
>     24317@debbugs.gnu.org
> 
> > That is better, yes.  Except that
> >
> >  (let ((case-fold-search)) (image-type-from-file-name "foo.JPEG"))
> >    => nil
> >
> > So I guess that function needs a minor change to be more robust.
> That's right.  It wuld be worth take a look on 
> 'image-type-from-file-name'.
> 
> I have corrected previous patch.  I drop expand-file-name from
> 'image-dired-jpeg-file-p'.  I also corrected the extra paren mentioned
> before.
> If people is happy with it i will apply this patch.

I think we should indeed use image-type instead of having yet another
function that recognizes JPEG.  The problem I pointed out should be
fixed in image-type-from-file-name, regardless.

Sorry this wasn't clear enough from what I wrote before.





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27 12:18             ` Tino Calancha
  2016-08-27 12:55               ` Eli Zaretskii
@ 2016-08-28  6:22               ` Andreas Schwab
  1 sibling, 0 replies; 15+ messages in thread
From: Andreas Schwab @ 2016-08-28  6:22 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Thien-Thi Nguyen, 24317

On Aug 27 2016, Tino Calancha <tino.calancha@gmail.com> wrote:

> diff --git a/lisp/image-dired.el b/lisp/image-dired.el
> index 67b023d..61b0751 100644
> --- a/lisp/image-dired.el
> +++ b/lisp/image-dired.el
> @@ -1205,6 +1205,10 @@ image-dired-dired-file-marked-p
>       (beginning-of-line)
>       (not (looking-at "^ .*$"))))
>
> +(defsubst image-dired-jpeg-file-p (file)
> +  "Return non-nil if FILE has a JPEG extension."
> +  (string-match-p "\\.[Jj][Pp][Ee]?[Gg]$" file))

FWIW, the regexp should end in "\\'".

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-27 12:55               ` Eli Zaretskii
@ 2016-08-28 12:26                 ` Tino Calancha
  2016-08-28 14:31                   ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Tino Calancha @ 2016-08-28 12:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ttn, 24317, schwab, Tino Calancha



On Sat, 27 Aug 2016, Eli Zaretskii wrote:

> I think we should indeed use image-type instead of having yet another
> function that recognizes JPEG.  The problem I pointed out should be
> fixed in image-type-from-file-name, regardless.
I see.  I have prepared following new patch:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From b953d600a295e4e0aa58b85126296663e7f02472 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Sun, 28 Aug 2016 21:20:22 +0900
Subject: [PATCH] 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.
---
  lisp/image-dired.el | 19 +++++++++----------
  lisp/image.el       |  2 +-
  2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 67b023d..34e4eae 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1912,8 +1912,8 @@ image-dired-rotate-original
        (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 @@ 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)))
-        (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
diff --git a/lisp/image.el b/lisp/image.el
index 272cee5..d1cdc44 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -343,7 +343,7 @@ image-type-from-file-name
    "Determine the type of image file FILE from its name.
  Value is a symbol specifying the image type, or nil if type cannot
  be determined."
-  (let (type first)
+  (let (type first (case-fold-search t))
      (catch 'found
        (dolist (elem image-type-file-name-regexps first)
  	(when (string-match-p (car elem) file)
-- 
2.9.3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.9)
  of 2016-08-27
Repository revision: 7fcce24e75b8281621a0b8816dc58cbdc05fdc91







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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-28 12:26                 ` Tino Calancha
@ 2016-08-28 14:31                   ` Eli Zaretskii
  2016-08-28 14:49                     ` Tino Calancha
  2016-09-04  2:19                     ` Tino Calancha
  0 siblings, 2 replies; 15+ messages in thread
From: Eli Zaretskii @ 2016-08-28 14:31 UTC (permalink / raw)
  To: Tino Calancha; +Cc: ttn, 24317, schwab

> > I think we should indeed use image-type instead of having yet another
> > function that recognizes JPEG.  The problem I pointed out should be
> > fixed in image-type-from-file-name, regardless.
> I see.  I have prepared following new patch:
> 
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >From b953d600a295e4e0aa58b85126296663e7f02472 Mon Sep 17 00:00:00 2001
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sun, 28 Aug 2016 21:20:22 +0900
> Subject: [PATCH] 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.

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





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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-28 14:31                   ` Eli Zaretskii
@ 2016-08-28 14:49                     ` Tino Calancha
  2016-09-04  2:19                     ` Tino Calancha
  1 sibling, 0 replies; 15+ messages in thread
From: Tino Calancha @ 2016-08-28 14:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ttn, 24317, schwab, Tino Calancha



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.
Thank you very much Eli.  I promise I will be patient :-)






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

* bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix
  2016-08-28 14:31                   ` Eli Zaretskii
  2016-08-28 14:49                     ` Tino Calancha
@ 2016-09-04  2:19                     ` Tino Calancha
  1 sibling, 0 replies; 15+ messages in thread
From: Tino Calancha @ 2016-09-04  2:19 UTC (permalink / raw)
  To: 24317-done



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.





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

end of thread, other threads:[~2016-09-04  2:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27  8:04 bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix Tino Calancha
2016-08-27  8:21 ` Eli Zaretskii
2016-08-27  8:53   ` Tino Calancha
2016-08-27  8:57     ` Eli Zaretskii
2016-08-27  9:21       ` Tino Calancha
2016-08-27  9:27         ` Tino Calancha
2016-08-27  9:42         ` Thien-Thi Nguyen
2016-08-27 11:28           ` Eli Zaretskii
2016-08-27 12:18             ` Tino Calancha
2016-08-27 12:55               ` Eli Zaretskii
2016-08-28 12:26                 ` Tino Calancha
2016-08-28 14:31                   ` Eli Zaretskii
2016-08-28 14:49                     ` Tino Calancha
2016-09-04  2:19                     ` Tino Calancha
2016-08-28  6:22               ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).