From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24317: 25.1.50; image-dired-rotate-original: regexp doesn't match .jpeg suffix Date: Sat, 27 Aug 2016 17:04:01 +0900 (JST) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1472285122 25863 195.159.176.226 (27 Aug 2016 08:05:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Aug 2016 08:05:22 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) To: 24317@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 27 10:05:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdYc7-0006Fl-F5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Aug 2016 10:05:15 +0200 Original-Received: from localhost ([::1]:35096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdYc5-0003D9-2B for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Aug 2016 04:05:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdYby-0003Ad-AW for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:05:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdYbu-0006eU-2K for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:05:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdYbt-0006eJ-Uy for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:05:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bdYbt-0006mF-OH for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Aug 2016 08:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24317 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147228506325999 (code B ref -1); Sat, 27 Aug 2016 08:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Aug 2016 08:04:23 +0000 Original-Received: from localhost ([127.0.0.1]:41817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdYbG-0006lH-Q3 for submit@debbugs.gnu.org; Sat, 27 Aug 2016 04:04:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdYbE-0006l4-Ij for submit@debbugs.gnu.org; Sat, 27 Aug 2016 04:04:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdYb8-0006T5-Aa for submit@debbugs.gnu.org; Sat, 27 Aug 2016 04:04:15 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdYb8-0006S0-8A for submit@debbugs.gnu.org; Sat, 27 Aug 2016 04:04:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdYb5-00032s-S1 for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:04:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdYb1-0006R6-LU for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:04:10 -0400 Original-Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]:33819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdYb1-0006QZ-CE for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 04:04:07 -0400 Original-Received: by mail-pa0-x243.google.com with SMTP id hh10so5866379pac.1 for ; Sat, 27 Aug 2016 01:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:user-agent:mime-version; bh=ApBnFWP7SpPG/3rRe9t0dSRhbYFctbZk2jwfffSneXg=; b=AVP4jiERU1yieRv4PqmDAiuFJXNFiq+u+zcqp90jkQbq0BtQtXzIEcj3WzDZVIGwll aqWdr5DtScse/3GmZVflrhtXmcRYuF0n095IwiGqjjcLQabG8gkl0xjM+z3+svs9oehI TBNTHk0jD067HCBsvuBLrZDf6yuL8l93lZwuV6UEUWDlwJ7PjjsVqzz98Aw8OOlYYyZ/ RFmIqihWiR/eq7qdFtLeMzo52bv0cyF+DTLnVS1wUKPrFSNddsx62ivs5P+hrDnGEPIA +MBSvnm02MQkSEcrJrHmH4Hs76QJN49m58PhfSi8p+4z3CH11irOZ3hs0aEmm6/bmA44 NomA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:user-agent :mime-version; bh=ApBnFWP7SpPG/3rRe9t0dSRhbYFctbZk2jwfffSneXg=; b=F9gpWmgud1S08Ec+4JOviDeoz69tVzYr6K3MPapNpKWEdfOUp2V5d7tbJac7ZEGpJ4 miPo4Z893rimraXDZh+yOmgqAhprnw0vR9XAeMg9DE9B/OCVLYwmpV/bDiphcwFP5EE0 OplDw/2DcK853bCUW2gDyKemCNgt8mt3tZ1C6P17yL/UP60hrDwd2DqTxm5o+/yEOXB8 6nNa9epOZtzz2UL32W0phGkR/bdjmGmDLCdNVyDglm2dIHHGLhK1HKwozMZzSzjasAfz gQAwIbju7KVVDW5k+dg+IEA3DUFdz63cMkgT4gZ0C7E4lXLfHCBRTqw5hzdUCCxVjmCL stUg== X-Gm-Message-State: AE9vXwOcCuogrD0uhPBm3bZ29U4VkJLcYaysI/m9vO3FO1CNwtabajSIXW3vA9TtMRvIMw== X-Received: by 10.66.199.66 with SMTP id ji2mr13356693pac.42.1472285044536; Sat, 27 Aug 2016 01:04:04 -0700 (PDT) Original-Received: from calancha-pc ([103.5.140.137]) by smtp.gmail.com with ESMTPSA id s1sm33943138paz.47.2016.08.27.01.04.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 01:04:04 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122710 Archived-At: 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 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