-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Issue with image max-width #776
Comments
@mojimi what's your WeasyPrint version? |
@liZe YES! That's exactly what I'm trying to achieve! 😞 But the images just stay at their original size... I'm using the latest version that comes with PIP, version 44 @Tontyna. I'm on a Windows 10 64 bits using Python 3.6.8, no errors are shown in output. And here's the py code from weasyprint import HTML, CSS
html = HTML('./report.html', encoding="utf-8")
html.write_pdf('./test.pdf', stylesheets=['./css.css']) |
Well… That's already what I get with WeasyPrint 44 using the HTML and CSS from your JsFiddle 😉. |
Aw man... Do you know anything I could try? What could it be? There has to be something different... I'm also running in a python 3.6 virtualenv and the code is running on a Flask server if that changes anything |
@Tontyna the cairosvg python package is 2.2.1, the .dll in GTK3 i'm not sure how to check the version. I just installed everything following the tutorial at the readthedocs documentation |
Python snippet to get the Cairo version: import cairocffi as cairo
print('Cairo:', cairo.cairo_version_string ()) |
Version 1.16.0 Thanks for the quick replies |
Same Cairo here. Hmm... @mojimi Maybe a stupid question, but: Does the jsFiddle indeed fail for you? |
No, the jsFiddle works for me! It shows what I'm trying to achieve. And the HTML/CSS I provided is exactly the same as my original as I'm just testing for now 😬 . But... I did some reinstalling and some cleaning and it works now! But using Bootstrap's flex row/columns still doesn't work, but that's fine, also if I'm not mistaken it does mention in the docs that flex is not perfect. Thanks for the help! This library is amazing much better than the alternatives |
Wrong wordings in my stupid question -- of course I wanted to ask whether the example you provided fails in WeasyPrint... ...since it works now everywhere: 🎉 |
😄
🎉 |
@liZe You can keep it closed, but I found out what the issue was. In my .css example I accidentaly used width instead of just max-width. By changing to max-width the problem does comeback, but just using width is fine for me. |
It's probably related to #656. |
All I'm trying to achieve here is a Bootstrap-like row/col behaviour where I have a table with equal width cells, and that images inside these cells stay inside the cells.
I've tried display : flex and display : table, but both seem to be ignoring the img's max-width style property.
I'm not sure what other way I could try to have the image fit it's parent in a table-like matter.
html :
css :
Working as expected in JsFiddle : http://jsfiddle.net/ppgab/zm7Lahdj/8/
The text was updated successfully, but these errors were encountered: