0.81 MacOS: Embedded aspect ratio issues

Older bugs which are supposed to be fixed in 0.84. *** Please try to reproduce your bug and confirm the bug fix. ***

Moderators: XnTriq, helmut, xnview, Dreamer

sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

0.81 MacOS: Embedded aspect ratio issues

Post by sd_snatcher »

When aspect ratio information is present inside PNG, TIF, JPG, BMP etc image files, XnViewMP will show both the thumbnail and the preview with incorrect proportions. Only after you open the image that it will be shown with its correct aspect.

Note: For GIF files, the image will still be shown with incorrect aspect ratio even when you open the files.

Use the following images to test the problem. They can be converted
http://frs.badcoffee.info/images/Zarth-PC88.png
http://frs.badcoffee.info/images/gifsui ... tratio.zip

Tested with XnViewMP 0.81 on Mac OS-X 10.10.5.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 Mac: Embedded aspect ratio issues

Post by xnview »

O.k., thank you, I can also reproduce the problem. Issue 950 is fixed in next version.
Pierre.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 Mac: Embedded aspect ratio issues

Post by xnview »

This problem is supposed to be fixed in XnView MP 0.85 beta 1. Please check and confirm the bug fix here.
Pierre.
sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

Re: XnView MP 0.85 beta 1

Post by sd_snatcher »

As requested, I tested the embedded aspect ratio bug with 0.85beta2 (Mac) and it's still present.

The files to test the problem can be found in the links bellow:

http://frs.badcoffee.info/images/Zarth-PC88.png
http://frs.badcoffee.info/images/gifsui ... tratio.zip
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: XnView MP 0.85 beta 1

Post by xnview »

Preview is always incorrect?? or only the thumbnail?
Pierre.
sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by sd_snatcher »

I just tested with XnView-MP v0.88 on Mac OS-X. These are the results:

1) Preview

The aspect ratio is shown correctly for JPG and PNG files. It is still incorrect for GIF files.

But there's a catch: ideally, the image should only be expanded to adjust the aspect ratio, so no pixel information is lost. But XnView is expanding them for changes in the vertical axis, and reducing them for changes in the horizontal axis.


2) Thumbnails in the file browser

The aspect ratio is incorrect for JPG, PNG and GIF files.


To help with the tests, I attached here three files with the same image saved in JPG, PNG and GIF formats. They all have the Pixel Aspect Ratio field set up inside them. In all cases, a black square should be rendered and all images should render the square with the same size.

- If a rectangle is seen, then the aspect ratio info isn't being respected.
- If the size of the rendered rectangle differs between all the rendered versions, then the Aspect Ratio scaler isn't scaling the axes by the same factor.
Attachments
PNG image with Pixel Aspect Ratio 2:1 set and a square drawn on it.
PNG image with Pixel Aspect Ratio 2:1 set and a square drawn on it.
ShouldBeSquare_2x1.png (716 Bytes) Viewed 3116 times
JPG image with Pixel Aspect Ratio 2:1 set and a square drawn on it.
JPG image with Pixel Aspect Ratio 2:1 set and a square drawn on it.
ShouldBeSquare_2x1.jpg (2.34 KiB) Viewed 3116 times
GIF image with Pixel Aspect Ratio 2:1 set and a square drawn on it.
GIF image with Pixel Aspect Ratio 2:1 set and a square drawn on it.
ShouldBeSquare_2x1.gif (2.39 KiB) Viewed 3116 times
PNG image with Pixel Aspect Ratio 1:2 set and a square drawn on it.
PNG image with Pixel Aspect Ratio 1:2 set and a square drawn on it.
ShouldBeSquare_1x2.png (612 Bytes) Viewed 3116 times
JPG image with Pixel Aspect Ratio 1:2 set and a square drawn on it.
JPG image with Pixel Aspect Ratio 1:2 set and a square drawn on it.
ShouldBeSquare_1x2.jpg (3.55 KiB) Viewed 3116 times
GIF image with Pixel Aspect Ratio 1:2 set and a square drawn on it.
GIF image with Pixel Aspect Ratio 1:2 set and a square drawn on it.
ShouldBeSquare_1x2.gif (1.97 KiB) Viewed 3116 times
Last edited by sd_snatcher on Sun Dec 31, 2017 12:41 pm, edited 6 times in total.
sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by sd_snatcher »

The formula for the GIF pixel aspect ratio can be seen at this link. It goes like this:

In a nutshell, it goes like this:

1) The Gif Aspect Ratio field is present at the offset +12 of the file.

2) The formula for the Pixel Aspect Ratio is this

- If HeaderAspectRatio = 0, then no Pixel Aspect Ratio is defined
- When HeaderAspectRatio > 0, PixelAspectRatio = (HeaderAspectRatio + 15) / 64
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by xnview »

:bugconfirmed: Thanks to your detailed description I can reproduce the problem.
Pierre.
sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by sd_snatcher »

It seems that some Pixel Aspect Ratios are still not shown correctly by XnView. Like the one in this attached image.
Attachments
Image with Pixel Aspect Ratio that doesn't render properly
Image with Pixel Aspect Ratio that doesn't render properly
cdfn2c08.png (404 Bytes) Viewed 3063 times
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by xnview »

See issue for current status and some details.
Pierre.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by xnview »

This problem is supposed to be fixed in XnView MP 0.91. Please check and confirm the bug fix here.
Pierre.
sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by sd_snatcher »

I just tested with XnView-MP v0.91-Beta4 on Mac OS-X. These are the results:

1) Preview

The aspect ratio is shown correctly for JPG, PNG and GIF files now.

But this problem still happens: "ideally, the image should only be expanded to adjust the aspect ratio, so no pixel information is lost. But XnView is expanding them for changes in the vertical axis, and reducing them for changes in the horizontal axis."

I attached a screenshot showing that 2:1 is being rendered much smaller than 1:1 and 1:2 on image view. But they should all be rendered at the same size.

2) Thumbnails in the file browser

The aspect ratio is still incorrect for JPG, PNG and GIF files, as show the attached screenshot.


To help with the tests, I made this page with a set of images. In all cases, all images of the same set (Lennas or squares) should be rendered with the same size.
Attachments
Screen Shot - 2x1 is being rendered much smaller on image view mode.jpg
Screen Shot - distorted thumbnails.jpg
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by xnview »

sd_snatcher wrote: Sat Aug 04, 2018 3:18 am To help with the tests, I made this page with a set of images. In all cases, all images of the same set (Lennas or squares) should be rendered with the same size.
where is the download link for images set?
Pierre.
sd_snatcher
Posts: 39
Joined: Sat Sep 10, 2016 11:29 pm

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by sd_snatcher »

The images can be downloaded directly from this page, with right-click:
http://frs.badcoffee.info/PAR_AcidTest

To make things easier, I also attached it here.
Attachments
PixelAspectRatio_tests_image_set.zip
(1.93 MiB) Downloaded 69 times
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.81 MacOS: Embedded aspect ratio issues

Post by xnview »

Are you sure that you have 'rebuild thumbnails'?

for preview, 512x256 & 256x512 should be expanded as 512x512 or 256x256?
Pierre.
Post Reply