all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Peter Münster" <pm@a16n.net>
To: 67149@debbugs.gnu.org
Subject: bug#67149: 30.0.50; save rotated image in image-mode
Date: Thu, 21 Mar 2024 19:12:55 +0100	[thread overview]
Message-ID: <871q83e9nc.fsf@a16n.net> (raw)
In-Reply-To: <87bkbx4sa2.fsf@a16n.net> ("Peter Münster"'s message of "Mon, 13 Nov 2023 15:55:17 +0100")

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

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

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

      reply	other threads:[~2024-03-21 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 14:55 bug#67149: 30.0.50; save rotated image in image-mode Peter Münster
2024-03-21 18:12 ` Peter Münster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q83e9nc.fsf@a16n.net \
    --to=pm@a16n.net \
    --cc=67149@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.