GNU bug report logs - #67149
30.0.50; save rotated image in image-mode

Previous Next

Package: emacs;

Reported by: Peter Münster <pm <at> a16n.net>

Date: Mon, 13 Nov 2023 14:57:01 UTC

Severity: wishlist

Found in version 30.0.50

To reply to this bug, email your comments to 67149 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67149; Package emacs. (Mon, 13 Nov 2023 14:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Münster <pm <at> a16n.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 13 Nov 2023 14:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Münster <pm <at> a16n.net>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.50; save rotated image in image-mode
Date: Mon, 13 Nov 2023 15:55:17 +0100
[Message part 1 (text/plain, inline)]
Hi,

This is a feature request. I would like to rotate an image by 90° and
save the result without using image-dired. It seems, that "i r" and "s
r" change only the display...

Could somebody add this feature please?

If not, could you please give some advice how to do that?

TIA for any help,
-- 
           Peter
[signature.asc (application/pgp-signature, inline)]

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 27 Dec 2023 21:39:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67149; Package emacs. (Thu, 21 Mar 2024 18:21:01 GMT) Full text and rfc822 format available.

Message #10 received at 67149 <at> debbugs.gnu.org (full text, mbox):

From: Peter Münster <pm <at> a16n.net>
To: 67149 <at> debbugs.gnu.org
Subject: Re: bug#67149: 30.0.50; save rotated image in image-mode
Date: Thu, 21 Mar 2024 19:12:55 +0100
[Message part 1 (text/plain, inline)]
On Mon, Nov 13 2023, Peter Münster wrote:

> This is a feature request. I would like to rotate an image by 90° and
> save the result without using image-dired. It seems, that "i r" and "s
> r" change only the display...
>
> Could somebody add this feature please?

Hi,

Here is my solution:

--8<---------------cut here---------------start------------->8---
(defun pm/img-rotate (dir)
  "Rotate active image to direction DIR."
  (call-process (concat "rot" dir ".sh") nil "*Messages*" nil (buffer-file-name))
  (revert-buffer nil t))

(defun pm/img-rotate-left ()
  "Rotate active image to the left."
  (interactive)
  (pm/img-rotate "left"))

(defun pm/img-rotate-right ()
  "Rotate active image to the right."
  (interactive)
  (pm/img-rotate "right"))

(define-key image-map "l" 'pm/img-rotate-left)
(define-key image-map "r" 'pm/img-rotate-right)
--8<---------------cut here---------------end--------------->8---

rotleft.sh and rotright.sh are using jpegtran for the rotation.

But there is one problem, that bothers me: When there is something like
"Orientation: Rotate 180" in the Exif metadata, the display is not
updated after the rotation.

My workaround: "exiftool -Orientation= image.jpg" and then restart Emacs.

What would be a cleaner solution please?

TIA for any help,
-- 
           Peter
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 141 days ago.

Previous Next


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