JPEG lossless transformations UGLY BUG?

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

Moderators: helmut, XnTriq, xnview

Mulder

JPEG lossless transformations UGLY BUG?

Post by Mulder »

using xnview 1.80.3 on win2000 or winXP try this:

- create an jpeg file with dimensions for instance 100x50, save it
- open it with xnview, do tools -> JPEG Losseless transformations -> Rotate 90 right (Ctrl+Shift+R)
- now the dimensions will be 48x100!
- do the same three times again, the image will return to it's previous form, but with dimensions 96x48!

I found that this is the same when using "Dialog ..." in JPEG Losseless transformations and checking "Trim image (remove unused pixels)" ... but how this function knows which pixels are unused (if this caused the problems)? In my case it removed possibly useful data from image ...
Anyway if the trim function is there with some intent, this should definitely not be the default manner when rotating using shortcut functions ... because I think everyone who uses this function excepts it just to rotate - not trim ...
User avatar
xnview
Author of XnView
Posts: 37883
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JPEG lossless transformations UGLY BUG?

Post by xnview »

Mulder wrote:using xnview 1.80.3 on win2000 or winXP try this:

- create an jpeg file with dimensions for instance 100x50, save it
- open it with xnview, do tools -> JPEG Losseless transformations -> Rotate 90 right (Ctrl+Shift+R)
- now the dimensions will be 48x100!
- do the same three times again, the image will return to it's previous form, but with dimensions 96x48!

I found that this is the same when using "Dialog ..." in JPEG Losseless transformations and checking "Trim image (remove unused pixels)" ... but how this function knows which pixels are unused (if this caused the problems)? In my case it removed possibly useful data from image ...
Anyway if the trim function is there with some intent, this should definitely not be the default manner when rotating using shortcut functions ... because I think everyone who uses this function excepts it just to rotate - not trim ...
It's normal, for jpeg lossless rotation picture must be multiple of 8/16
Pierre.
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France

Re: JPEG lossless transformations UGLY BUG?

Post by Olivier_G »

xnview wrote:It's normal, for jpeg lossless rotation picture must be multiple of 8/16
Well, if you select "lossless rotation" it is obviously that you care about data, and having a certain amount of the picture lost without warning is... bad. :(

In the rotation dialog, you should have an option "if dimensions are not multiple of 8":
A. Apply lossless rotation on the trimmed 8x8 multiple part +Append lossy rotation of the extra part
B. Fill in with a selected color to get 8x8 multiple before making lossless rotation (1 JPEG compression for the extra modified part would be necessary)
C. Trim to 8x8 multiple
D. Do Nothing
E. Ask with a dialog pop-up
...and this setting should apply when you select any Lossless JPEG operation.

Olivier
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Post by JohnFredC »

jpeg lossless rotation picture must be multiple of 8/16
Of course something like this must be the case but...

I didn't know it before. Good to know now, though! Thanks!
John
Dreamer
XnThusiast
Posts: 4608
Joined: Sun Jul 25, 2004 9:08 pm

Re: JPEG lossless transformations UGLY BUG?

Post by Dreamer »

Olivier_G wrote:
xnview wrote:It's normal, for jpeg lossless rotation picture must be multiple of 8/16
Well, if you select "lossless rotation" it is obviously that you care about data, and having a certain amount of the picture lost without warning is... bad. :(

In the rotation dialog, you should have an option "if dimensions are not multiple of 8":
A. Apply lossless rotation on the trimmed 8x8 multiple part +Append lossy rotation of the extra part
B. Fill in with a selected color to get 8x8 multiple before making lossless rotation (1 JPEG compression for the extra modified part would be necessary)
C. Trim to 8x8 multiple
D. Do Nothing
E. Ask with a dialog pop-up
...and this setting should apply when you select any Lossless JPEG operation.

Olivier
I agree, same with lossless crop...

E.g.: show "unusable" resolution in red (in status bar) or allow to select just "usable" resolution.