unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* image-dired does not rotate the original image
@ 2007-07-22 12:02 Dieter Wilhelm
  2007-07-22 12:50 ` Mathias Dahl
  0 siblings, 1 reply; 8+ messages in thread
From: Dieter Wilhelm @ 2007-07-22 12:02 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: mathias.dahl

Hi

please do:

emacs -Q
M-x tumme [some directory with jpegs]
R (image-dired-rotate-original-right)

yields the following error message:

  image-dired-rotate-original: Could not rotate image

----------------------------------------------------------------------

In GNU Emacs 22.1.5 (x86_64-unknown-linux-gnu, GTK+ Version 2.8.20)
 of 2007-07-01 on debby
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--with-gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-agent-mode: t
  gnus-undo-mode: t
  shell-dirtrack-mode: t
  iswitchb-mode: t
  display-time-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
<down> <down> <down> <up> <up> <up> <up> <up> <up> 
<up> <down> l <right> l <down> <left> l <right> l <right> 
l <down> <left> <left> l <right> l <right> l <down> 
<left> <left> l <right> l <right> l <down> <left> <left> 
l <right> l <right> l <down> <left> <left> l <right> 
l <right> l <down> <left> <left> l <right> l <right> 
l <down> <left> <left> l <right> l <right> l <down> 
<left> <left> l r <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <down> 
<down> <down> <down> <down> <down> <down> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <left> 
<up> <down> <up> <up> <down> <up> <f4> <f5> <f6> M-x 
e m a c s - b <tab> <backspace> r e <tab> p <M-backspace> 
<M-backspace> r e p o <tab> r t - e m <tab> <return> 
C-g <f3> <f4> <f5> <f6> <f7> <f8> <f7> <f6> <f5> <f4> 
<f3> <f2> <f1> <f2> <f3> <f3> <f4> <f5> <f6> <f7> <f8> 
<f7> <f6> <f5> <f4> <f3> <f2> <f3> <f1> M-x M-p C-g 
<f2> M-x M-p <return>

Recent messages:
2007_07_14: IMG_0401.JPG (): 

2007_07_14: IMG_0398.JPG (): 
line-move-1: Beginning of buffer

2007_07_14: IMG_0401.JPG (): 

2007_07_14: IMG_0398.JPG (): 
Making completion list...
Loading emacsbug...done
Quit [2 times]

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

* Re: image-dired does not rotate the original image
  2007-07-22 12:02 image-dired does not rotate the original image Dieter Wilhelm
@ 2007-07-22 12:50 ` Mathias Dahl
  2007-07-22 13:34   ` Dieter Wilhelm
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Dahl @ 2007-07-22 12:50 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: bug-gnu-emacs

> emacs -Q
> M-x tumme [some directory with jpegs]
> R (image-dired-rotate-original-right)
>
> yields the following error message:
>
>   image-dired-rotate-original: Could not rotate image

By default, `image-dired-cmd-rotate-original-program' is set to
jpegtran, which is a command that can rotate a JPEG without quality
loss. This is a must, unless there are other tools that does the same
job. Do you have this program installed? Can you call it from a
terminal?

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

* Re: image-dired does not rotate the original image
  2007-07-22 12:50 ` Mathias Dahl
@ 2007-07-22 13:34   ` Dieter Wilhelm
  2007-07-22 13:52     ` Mathias Dahl
  0 siblings, 1 reply; 8+ messages in thread
From: Dieter Wilhelm @ 2007-07-22 13:34 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: bug-gnu-emacs

"Mathias Dahl" <mathias.dahl@gmail.com> writes:

>> emacs -Q
>> M-x tumme [some directory with jpegs]
>> R (image-dired-rotate-original-right)
>>
>> yields the following error message:
>>
>>   image-dired-rotate-original: Could not rotate image
>
> By default, `image-dired-cmd-rotate-original-program' is set to
> jpegtran, which is a command that can rotate a JPEG without quality

I'm sorry, I was convinced that the image-magick suite would be enough
for tumme's image manipulations but now I see that you mentioned
jpegtran in the manual.

Lets see what the respective debian package name is:
$ apt-file search jpegtran
libjpeg-progs: usr/bin/jpegtran

> loss. This is a must, unless there are other tools that does the same

Why can't you just use convert?  It's needed for the image-dired
thumbs anyway, is it too slow?

> job. Do you have this program installed? Can you call it from a
> terminal?

OK, installed libjpeg-progs and it works now, thanks.  But its a bit
awkward since I'm constantly asked whether I'd like to change the
original file and when I decline the rotated display is again
reverted.  I could imagine that this becomes very annoying when
displaying stuff from a read only drive.

Does it make sense to check the existence of the needed image-magick
and jpegtran executables with the Emacs configure script?

And it would be helpful if the error message could give a hint which
kind of executable is missing.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: image-dired does not rotate the original image
  2007-07-22 13:34   ` Dieter Wilhelm
@ 2007-07-22 13:52     ` Mathias Dahl
  2007-07-22 17:01       ` Thien-Thi Nguyen
       [not found]       ` <mailman.3767.1185123740.32220.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Mathias Dahl @ 2007-07-22 13:52 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: bug-gnu-emacs

> Why can't you just use convert?  It's needed for the image-dired
> thumbs anyway, is it too slow?

As I mentioned earlier, jpegtran does lossless rotation, something
`convert' cannot do (or could not the last time I checked). The point
of the R and L commands are to rotate the original file, it was not
intended for rotating the displayed image. The only such command that
exist yet is the rotation of the thumbnails.

> OK, installed libjpeg-progs and it works now, thanks.  But its a bit
> awkward since I'm constantly asked whether I'd like to change the
> original file and when I decline the rotated display is again
> reverted.

That is because I designed that command to rotate the original, it was
not intended for rotate of the displayed image, for view purposes.
That is why you get the confirmation, because it will overwrite the
original file. Maybe this was not the best design decision but it was
what I wanted/needed when I implemented it. Feel free to write a new
command if you like, the code for rotating is there for thumbnails
already.

> Does it make sense to check the existence of the needed image-magick
> and jpegtran executables with the Emacs configure script?

`image-dired.el' should make more sanity checks in this area, that is
what is missing. I was too lazy to add them...

/Mathias

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

* Re: image-dired does not rotate the original image
  2007-07-22 13:52     ` Mathias Dahl
@ 2007-07-22 17:01       ` Thien-Thi Nguyen
       [not found]       ` <mailman.3767.1185123740.32220.bug-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Thien-Thi Nguyen @ 2007-07-22 17:01 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: Dieter Wilhelm, bug-gnu-emacs

() "Mathias Dahl" <mathias.dahl@gmail.com>
() Sun, 22 Jul 2007 15:52:16 +0200

   As I mentioned earlier, jpegtran does lossless rotation, something
   `convert' cannot do (or could not the last time I checked).

does this limitation also exist w/ mogrify(1) (or alternatively gm(1)
subcommand mogrify)?  i suppose to check for loss one could use:

 cp foo.jpg foo.orig.jpg
 gm mogrify -rotate -90 foo.jpg
 gm mogrify -rotate  90 foo.jpg
 cmp foo.jpg foo.orig.jpg

however, doing the above (even w/ "-quality 100" for the mogrify commands)
always results in cmp(1) noting a difference, even though visually i could
not tell.  i'm not a graphics format expert; could you suggest a better
way to check for loss?

thi

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

* Re: image-dired does not rotate the original image
       [not found]       ` <mailman.3767.1185123740.32220.bug-gnu-emacs@gnu.org>
@ 2007-07-24  6:52         ` Mathias Dahl
  2007-07-24 22:50           ` Dieter Wilhelm
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Dahl @ 2007-07-24  6:52 UTC (permalink / raw)
  To: gnu-emacs-bug

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

>    As I mentioned earlier, jpegtran does lossless rotation, something
>    `convert' cannot do (or could not the last time I checked).
>
> does this limitation also exist w/ mogrify(1) (or alternatively gm(1)
> subcommand mogrify)?

I don't know. What I do know is that `convert' makes a lossy rotation
of JPEGs. I found this out myself while creating Tumme; while in the
thumbnail buffer, rotate a thumbnail over and over again. Because of
the small size you soon begin to see changes.

>  cp foo.jpg foo.orig.jpg
>  gm mogrify -rotate -90 foo.jpg
>  gm mogrify -rotate  90 foo.jpg
>  cmp foo.jpg foo.orig.jpg
>
> however, doing the above (even w/ "-quality 100" for the mogrify commands)
> always results in cmp(1) noting a difference, even though visually i could
> not tell.

If you do that in a loop, say ten or more times, maybe you will start
to see a difference (save the original and compare it visually).

>  i'm not a graphics format expert; could you suggest a better
> way to check for loss?

How about rotating the image in Gimp, for comparison?

Maybe there should be an option in `image-dired' to allow lossy
rotation, so that people who accept that do not need to have
`jpegtran'?

/Mathias

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

* Re: image-dired does not rotate the original image
  2007-07-24  6:52         ` Mathias Dahl
@ 2007-07-24 22:50           ` Dieter Wilhelm
  2007-07-25  7:25             ` Mathias Dahl
  0 siblings, 1 reply; 8+ messages in thread
From: Dieter Wilhelm @ 2007-07-24 22:50 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: gnu-emacs-bug

Mathias Dahl <brakjoller@gmail.com> writes:

> Thien-Thi Nguyen <ttn@gnuvola.org> writes:
>
>>    As I mentioned earlier, jpegtran does lossless rotation, something
>>    `convert' cannot do (or could not the last time I checked).
>>
>> does this limitation also exist w/ mogrify(1) (or alternatively gm(1)
>> subcommand mogrify)?

What I see in the documentation for mogrify is:

"This tool is similiar to convert except the original image file is overwritten"

So it's probably no use for Mathias. 

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: image-dired does not rotate the original image
  2007-07-24 22:50           ` Dieter Wilhelm
@ 2007-07-25  7:25             ` Mathias Dahl
  0 siblings, 0 replies; 8+ messages in thread
From: Mathias Dahl @ 2007-07-25  7:25 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: gnu-emacs-bug, Mathias Dahl

> What I see in the documentation for mogrify is:
>
> "This tool is similiar to convert except the original image file is overwritten"

Exactly. The only difference between mogrify and convert, AFAIK, is
that you do not need to use a temp file to modify a file permanently.
It uses the same algorithms for what it does.

> So it's probably no use for Mathias.

Not if we want to do a lossless JPEG rotation, no.

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

end of thread, other threads:[~2007-07-25  7:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-22 12:02 image-dired does not rotate the original image Dieter Wilhelm
2007-07-22 12:50 ` Mathias Dahl
2007-07-22 13:34   ` Dieter Wilhelm
2007-07-22 13:52     ` Mathias Dahl
2007-07-22 17:01       ` Thien-Thi Nguyen
     [not found]       ` <mailman.3767.1185123740.32220.bug-gnu-emacs@gnu.org>
2007-07-24  6:52         ` Mathias Dahl
2007-07-24 22:50           ` Dieter Wilhelm
2007-07-25  7:25             ` Mathias Dahl

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).