Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Png/Jpg images rendered on linux are stretched on windows #11160

Closed
sergiuiscoding opened this issue Mar 22, 2013 · 8 comments
Closed

Png/Jpg images rendered on linux are stretched on windows #11160

sergiuiscoding opened this issue Mar 22, 2013 · 8 comments
Labels

Comments

@sergiuiscoding
Copy link

Tested with phantomjs 1.8.2 on ubuntu 11.04/12.04

phantomjs ../examples/rasterize.js http://google.com google.png

The rendered image looks good on the same linux machine, but seems to have wrong pixel aspect ratio on a windows machine.
If I open the image in an image editor (paint.net, photoshop) the image looks good. So I'm guessing there's some kind of metadata messed-up.

Original image fixed on upload as attachment (or by viewing it in the browser):

google

Print screen with the issue:

print_screen

@sergiuiscoding
Copy link
Author

Uploading the image as an attachment seems to have corrected the issue.

@sergiuiscoding
Copy link
Author

ImageMagick:

identify -verbose image.png

[...] Properties: date:create: 2013-03-22T11:24:34+02:00 date:modify: 2013-03-22T11:14:45+02:00 png:IHDR.bit-depth-orig : 8 png:IHDR.bit_depth : 8 png:IHDR.color-type-orig : 6 png:IHDR.color_type : 6 (RGBA) png:IHDR.interlace_method: 0 (Not interlaced) png:IHDR.width,height : 652, 600 png:pHYs : x_res=4055, y_res=4331, units=1 png:sRGB : intent=0 (Perceptual Intent)

@JamesMGreene
Copy link
Collaborator

I'm assuming those details are from the "stretchy" image. What are the details for it when it isn't stretchy?

@sergiuiscoding
Copy link
Author

Details of image rendered with my fix in place (Attn at x_res / y_res):

[...] Properties: date:create: 2013-03-22T15:00:35+02:00 date:modify: 2013-03-22T15:00:33+02:00 png:IHDR.bit-depth-orig : 8 png:IHDR.bit_depth : 8 png:IHDR.color-type-orig : 6 png:IHDR.color_type : 6 (RGBA) png:IHDR.interlace_method: 0 (Not interlaced) png:IHDR.width,height : 604, 600 png:pHYs : x_res=2834, y_res=2834, units=1 png:sRGB : intent=0 (Perceptual Intent)

@ariya
Copy link
Owner

ariya commented May 15, 2013

I finally found out a possible lead.

PNG image writer needs to get horizontal and vertical resolutions. Qt's default horizontal and vertical dpi values are obtained via qt_defaultDpiX() and qt_defaultDpiY() (see src/gui/text/qfont.cpp). For our headless implementation on Linux, apparently some QPlatformScreen settings are either incomplete or incorrect, thus giving a wrong dpi.

@ariya
Copy link
Owner

ariya commented May 15, 2013

@sudosu- Can you try this with 1.9? I think I fixed this already in 3f42fb230f (see issue #10659).

@sergiuiscoding
Copy link
Author

@ariya thank you for looking into this. I've just tested with 1.9 and cannot reproduce the issue anymore. The PNG looks good.
So I guess my workaround is not necessary anymore, will switch to the official release.

@stale stale bot added the stale label Dec 27, 2019
@stale
Copy link

stale bot commented Dec 30, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants