all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67149: 30.0.50; save rotated image in image-mode
@ 2023-11-13 14:55 Peter Münster
  2024-03-21 18:12 ` Peter Münster
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Münster @ 2023-11-13 14:55 UTC (permalink / raw)
  To: 67149

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

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

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

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

* bug#67149: 30.0.50; save rotated image in image-mode
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Münster @ 2024-03-21 18:12 UTC (permalink / raw)
  To: 67149

[-- 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 --]

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

end of thread, other threads:[~2024-03-21 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.