Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image width not calculated from height #66

Closed
Smylers opened this issue Mar 26, 2013 · 1 comment
Closed

Image width not calculated from height #66

Smylers opened this issue Mar 26, 2013 · 1 comment

Comments

@Smylers
Copy link
Contributor

Smylers commented Mar 26, 2013

When setting an image's height, its width isn't being calculated to scale.

For example, see this page, which renders as expected in Firefox:
http://www.stripey.com/demo/weasyprint/squished_cattle.html

But in WeasyPrint an image with an explicit height directive uses the image's intrinsic width, rather than scaling it so as to keep its intrinsic ratio to fit with the explicit height: http://www.stripey.com/demo/weasyprint/squished_cattle.pdf

The relevant part of the spec — I think the third paragraph's second option (starting “or if”) applies.

T'other way round works fine: specifying just a width causes the appropriate height to be calculated.

@SimonSapin
Copy link
Member

Thanks for the detailed report. It looks like I just read the spec wrong.

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

No branches or pull requests

2 participants