JPEG Lossless Rotate failed

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, xnview

Post Reply
BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

JPEG Lossless Rotate failed

Post by BrokenAutoImageSize » Sun Nov 29, 2009 2:42 pm

XnView 1.96.5.

I have a bunch of JPEG from my camera with EXIF orientation flag set.
XnView shipped to me with checked option "Rotate images based on EXIF orientation", and all works fine.

Now I prepare a photos CDROM for another peoples. I didn't sure that they have XnView installed with correct options and even they even as know about XnView, so I go to Windows Explorer, turn Thumbnails view mode and see that some images have raw image data and cant be viewed without rotation.

I return to XnView, select JPEG image with picture rotated counter clockwise from normal orientation and press "Rotate Clockwise button", image rotates by 180 degrees.
Then I press "Rotate Counter Clockwise" and image becomes OK.

Searching brings me that topic about crazy rotations: http://newsgroup.xnview.com/viewtopic.php?f=36&t=18029

My suggestions:
1. By pressing "Rotate" buttons I mean that XnView will not show extra-AI-manipulating-EXIF-flags to me but throws away EXIF data, takes raw image data, rotate it in specified direction and write back to same file.
2. Early I saw ACDSee program which have a simple flag in rotate dialog: "rotate based on EXIF orientation", it works brilliant.
Please add this simple option to Rotate Transformation "[x] rotate based on EXIF orientaton"
3. About "XnView only rewrites EXIF flag instead of rotation" issue: there will be another clear option:
[x] rewrite EXIF orientation instead of rotate if possible
so all the users takes predictable results.

Thank you.

P.S. sorry for my English :)

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Rotate failed

Post by xnview » Mon Nov 30, 2009 9:01 am

BrokenAutoImageSize wrote: 2. Early I saw ACDSee program which have a simple flag in rotate dialog: "rotate based on EXIF orientation", it works brilliant.
Please add this simple option to Rotate Transformation "[x] rotate based on EXIF orientaton"
You have 'rotate based on EXFI value'
3. About "XnView only rewrites EXIF flag instead of rotation" issue: there will be another clear option:
[x] rewrite EXIF orientation instead of rotate if possible
The label is changed in 1.97
Pierre.

BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

Re: Rotate failed

Post by BrokenAutoImageSize » Mon Nov 30, 2009 10:14 am

Thank you, waiting for 1.97 release

BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

Re: Rotate failed

Post by BrokenAutoImageSize » Thu Jun 10, 2010 7:53 pm

Nothing changed in 1.97.4 release:

take orientation values from http://www.impulseadventure.com/photo/e ... ation.html
Image

What I do:
- I see an image rotated in position (8).
- I press button "Rotate Left" or press Ctrl-Shift-L
- XnView rotate and redraw image to position (6).
- I press button "rotate right"
- XnView rotate image and it become to correct position (1)

I mean it will be easy to program simple rotation algorithm :(

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Rotate failed

Post by xnview » Fri Jun 11, 2010 7:49 am

Could you send me the jpeg file?
Pierre.

bucky
Posts: 30
Joined: Thu Mar 19, 2009 6:22 am

Re: Rotate failed

Post by bucky » Mon Jul 05, 2010 8:00 am

I get the same exact behavior in XnView 1.97.6, running on XP SP3. Here is how to reproduce:

XnView settings:
general > operations: uncheck "Rotate images according to EXIF orientation tag"
browser > misc: uncheck "Change EXIF orientation ONLY when possible (JPEG)"
browser > misc: check "Use lossless rotation when possible (JPEG)"

Original image:
EXIF orientation: right-top (6)

Action: Tools > JPEG Lossless Transformation > Rotate 90 right
Result is 180 degree lossless rotate, and the EXIF orientation is now top-left (1)

If I then do a Lossless Rotate 90 left, then it's correct. I think the lossless rotate works correctly when EXIF orientation is "top-left (1)", but does not work correctly when the original orientation is something else.

BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

Re: Rotate failed

Post by BrokenAutoImageSize » Mon Jul 05, 2010 5:35 pm

AFAIK from Pierre (author of xnview) this bug will fixed in future version.
If you want to work fine at current version, check the
[x] option/General/File operations>For losseless operation make a backup

but xnview will left original JPEG files on disk.

marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Rotate failed

Post by marsh » Mon Jul 05, 2010 8:44 pm

If Exif orientation was wrong in first place, the first pass will always reset to top left to correct it and then a second pass will look as expected?
A problem of jpeg transform dialog in viewer using Exif orientation when it wasn't supposed to (with following option) was fixed recently.
General [ ]Rotate images according to exif orientation flag.
This option is good one to leave off if anyone has jpg with flag that doesn't match image, IMO.

BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

Re: Rotate failed

Post by BrokenAutoImageSize » Mon Jul 05, 2010 8:56 pm

But some people preferred to have all their images was correctly rotated in Top-Left (1) position.
8-)

bucky
Posts: 30
Joined: Thu Mar 19, 2009 6:22 am

Re: Rotate failed

Post by bucky » Tue Jul 06, 2010 1:29 am

@BrokenAutoImageSize: Changing that setting works. Interesting.

@Marsh: The EXIF orientation was not incorrect. I took a "portrait" photo, which my camera marked correctly as "right-top (6)". I already had the setting off: General [ ]Rotate images according to exif orientation flag.

marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Rotate failed

Post by marsh » Tue Jul 06, 2010 11:36 am

@BrokenAutoImageSize @bucky
Ok. I can confirm problems too.

Here is what happens on first pass (rotating with browser toolbar buttons) when Exif flag reads 8,3, or 6 and it doesn't match origin (top-left) shown in properties tab:
A.
[x]rotate according to exif [ ]change exif only; (default settings)- rotating clockwise or counterclockwise: nothing unusual seen but...
-viewing according to exif, but no change to it is sought*
B.
[ ]rotatate according to exif [ ]change exif only;- rotating clockwise: Exif 8, no view shift seen; Exif 3, shifts 270 degrees; Exif 6, shifts 180
-not viewing according to exif flag, but no change to it is sought*; and it isn't being bypassed*
C.
[x]rotatate according to exif [x]change exif only; - rotating clockwise or counterclockwise: nothing unusual seen
-viewing according to flag and not changing image content
D.
[ ]rotatate according to exif [x]change exif only; - nothing seen
-not viewing according to flag, but changing it anyway

I think these ideas are already found in transformation dialog. Good as defaults elsewhere?
1. not reset exif
2. ignore exif data when not viewing according to it.

BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

Re: Rotate failed

Post by BrokenAutoImageSize » Tue Jul 06, 2010 6:23 pm

My friend wrote a little utility for cleaning directory:
http://code.activestate.com/recipes/577 ... e-utility/

Written in Python (http://python.org/)

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Rotate failed

Post by xnview » Tue Sep 07, 2010 12:29 pm

Please try XnView 1.97.7
Pierre.

BrokenAutoImageSize
Posts: 17
Joined: Fri Aug 21, 2009 1:00 am

Re: Rotate failed

Post by BrokenAutoImageSize » Tue Sep 07, 2010 12:51 pm

Suppose that new version works fine!
Thank you!

Hacker
Posts: 206
Joined: Tue May 17, 2005 9:24 pm
Location: Bratislava, Slovakia
Contact:

Re: Rotate failed

Post by Hacker » Thu Sep 09, 2010 12:42 pm

Yay, confirmed working in 1.97.7! :D

Thanks!
Roman

Post Reply