Photo App and lossless rotation

Reported bugs that have been closed and/or resolved

Moderators: XnTriq, helmut, xnview, Dreamer

Post Reply
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Photo App and lossless rotation

Post by Plotino »

Hi,

Photo App of Windows 8.1 and 10 is able to apply lossless rotation of images whose dimensions are not multiple of 8 and the images are not cropped. Photo App modifies Exif orientation. I opened the images in PowerDirector and they are rotated
Please add this feature to XnViewMP too
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Photo App and lossless rotation

Post by XnTriq »

Plotino wrote:Photo App modifies Exif orientation.
Please activate Change EXIF orientation ONLY (if possible) in ToolsSettings...BrowserMisc..
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

Yes I did, but it doesn't work. Rotation is always lossy. If I check even "Use lossless rotation (if possible)" XnViewMP crops the image, and I don't want this.
Photo App does a lossless rotation of the image I attached, XnViewMP doesn't
Attachments
lav (04)_1377164681_675x0.jpg
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Photo App and lossless rotation

Post by xnview »

Strange, i have tested with 'Change EXIF orientation' checked, and 'Use lossless rotation' not checked, and this is the result
Copy of lav (04)_1377164681_675x0.jpg
There is no EXIF, so XnViewMP can't change the EXIF orientation field, so picture is re-saved (without cropping)
Pierre.
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

No problem to rotate without crop, as you said, simply leave 'Use lossless rotation' not checked
Rotation isn't lossless
I don't know how it does, but Photo App applies lossless rotation.
You can test with Paint.NET

open the copied, rotated file.
Edit...Select All
Edit...Copy
File...Open (..then specify the original file)
Edit...Paste into New layer
Layers...Layer Properties...Difference
Image...Flatten
Adjustments...Auto-Level

if the result is a black image the rotation is lossless


Please, investigate Photo App behavior. Imho it's important
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

I used Exiftool to obtain information from the picture before and after Photo App rotation.

Before

Code: Select all

ExifTool Version Number         : 9.03
File Name                       : lav (04)_1377164681_675x0.jpg
Directory                       : F:/Documenti/Download/Y - Video - Audio Editing/MkvToMp4_0.224/Tools/ExifTool
File Size                       : 114 kB
File Modification Date/Time     : 2017:06:03 17:26:11+02:00
File Access Date/Time           : 2017:06:03 17:26:06+02:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Comment                         : CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 95.
Image Width                     : 675
Image Height                    : 450
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 675x450

After

Code: Select all

ExifTool Version Number         : 9.03
File Name                       : lav (04)_1377164681_675x0.jpg
Directory                       : F:/Documenti/Download/Y - Video - Audio Editing/MkvToMp4_0.224/Tools/ExifTool
File Size                       : 130 kB
File Modification Date/Time     : 2017:06:07 15:24:07+02:00
File Access Date/Time           : 2017:06:07 15:24:07+02:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : inches
X Resolution                    : 96
Y Resolution                    : 96
Exif Byte Order                 : Big-endian (Motorola, MM)
Processing Software             : Windows Photo Editor 6.3.9600.17418
Orientation                     : Rotate 270 CW
Software                        : Windows Photo Editor 6.3.9600.17418
Modify Date                     : 2017:06:07 15:24:03
Padding                         : (Binary data 2060 bytes, use -b option to extract)
Comment                         : CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 95.
About                           : uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b
Creator Tool                    : Windows Photo Editor 6.3.9600.17418
Image Width                     : 675
Image Height                    : 450
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 675x450
As you can see, there is this new value "Orientation: Rotate 270 CW"
So Photo App write info in Exif.

After that the image is rotated with Photo App I can perform rotation with XnViewMP as you did, but only now the rotation is lossless
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Photo App and lossless rotation

Post by XnTriq »

xnview wrote:There is no EXIF, so XnViewMP can't change the EXIF orientation field, so picture is re-saved (without cropping)
I can confirm that lav (04)_1377164681_675x0.jpg doesn't contain any EXIF info :-|
How-To Geek ([url=http://www.howtogeek.com/254830/why-your-photos-dont-always-appear-correctly-rotated/]Why Your Photos Don’t Always Appear Correctly Rotated[/url]) wrote:For example, on Windows 7, Windows Photo Viewer and Windows Explorer ignore the Exif Orientation tag. Windows 8 added support for the Exif Orientation tag, which continued into Windows 10. Images may appear correct on a Windows 10 or 8 PC, but rotated differently on a Windows 7 PC.

[…]

Modern smartphones and digital cameras have faster hardware, so it should be possible for them to save photos in an already-rotated state instead of just applying the Exif Orientation tag. Unfortunately, the industry seems to have settled in Exif Orientation tags as the standard solution, even if they aren’t ideal.
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

Maybe Photo App adds Exif information?
Try the same step I did
Photo App lossless rotation is a fact, it isn't my opinion :)
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Photo App and lossless rotation

Post by XnTriq »

Plotino wrote:Photo App lossless rotation is a fact, it isn't my opinion :)
I'm sure you're right, Plotino! Thing is that I don't have access to Windows 8/8.1 or 10.
Could you please upload the original and processed files so Pierre (and the rest of us) can have a look at the EXIF injected by Windows Photo Editor?
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

Thanks for your patience
Attachments
images.zip
(244.02 KiB) Downloaded 48 times
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Photo App and lossless rotation

Post by xnview »

O.k., thank you, I can also reproduce the problem. Issue 1204 is fixed in next version.
Pierre.
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

Please, add this type of rotation to View and Slideshow mode as well
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Photo App and lossless rotation

Post by xnview »

This problem is supposed to be fixed in XnView MP 0.87. Please check and confirm the bug fix here.
Pierre.
Plotino
Posts: 19
Joined: Mon Oct 10, 2011 11:16 am

Re: Photo App and lossless rotation

Post by Plotino »

Yes, pictures are now rotated altering the Exif orientation.
This is very good for images whose dimensions are not multiple of 8, however pictures whose dimensions are multiple of 8, IMHO, should be rotated in the standard lossless rotation way. I mean according to jpegtran rules
Post Reply