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

Fix for #11160 (Wrong PNG/JPEG resolution on linux) #11170

Closed
wants to merge 1 commit into from
Closed

Fix for #11160 (Wrong PNG/JPEG resolution on linux) #11170

wants to merge 1 commit into from

Conversation

sergiuiscoding
Copy link

Fix png/jpg resolution metadata which caused the images to render stretched.

@ariya
Copy link
Owner

ariya commented Mar 26, 2013

Without more explanation why this unifies the resolution on Linux and Windows, I don't understand its purpose.

@sergiuiscoding
Copy link
Author

From what I've found out (see #11160) the rendered image has some messed-up metadata (specifically x res / y res) which causes the image to be rendered with wrong aspect ratio (aka stretched) by some viewers (Windows Photo Viewer).
By setting "dotsPerMeter" we correct the resolution / image aspect ratio, so it's rendered consistently across viewers/platforms.

@ariya
Copy link
Owner

ariya commented Mar 27, 2013

Sure, it does explain what the fix does. However, I'm still baffled as to why QImage produces different resolution in Linux vs other platforms.

@sergiuiscoding
Copy link
Author

I see. I've reduced the rendering code to just a few lines (by the book, disabling the tile-based rendering), so I'm guessing the problem is somewhere in QWebFrame::render() or somewhere down the road. Unfortunately I don't have time to dig on this lead. I badly needed a fix for this, so setting the dpm did the trick.

@ariya
Copy link
Owner

ariya commented Mar 30, 2013

Fair enough, but let's postpone landing the fix until we really know what causes the issue. Also, with our rendering-to-base64 feature, this should be tested as well to prevent future regressions.

@sergiuiscoding
Copy link
Author

Closing as the issue has been fixed in the 1.9 release (3f42fb2)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants