question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG Regression: Intrinsic Ratios

See original GitHub issue

I am using the CLI to build my PDFs, which contain both inline and <img/> SVGs, which may or may not have an intrinsic height and/or width. Instead, all images are sized using CSS-only.

After updating to 53-stable, I am now receiving the following error:

File “/usr/local/lib/python3.9/site-packages/weasyprint/layout/preferred.py”, line 122, in min_max ratio = box.replacement.intrinsic_ratio AttributeError: ‘SVGImage’ object has no attribute ‘intrinsic_ratio’

I am assuming 2e96bdee356b7971446861ecd217050d3c8e91f9 has something to do with it. Does this mean I must now specify these dimensions in my SVG files? The problem here is that these SVGs are user-provided, which means I would need to build a processor to add them upon upload.

Or perhaps I am missing something…?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
liZecommented, Aug 22, 2021

@mikerockett Version 53.1 has been released today!

2reactions
mikerockettcommented, Aug 5, 2021

Ah right, so that commit was actually the fix, not the problem. 😅 Great stuff, I’ll wait for the release then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

441862 - SVG image with intrinsic ratio but no ... - Monorail
Issue 441862: SVG image with intrinsic ratio but no intrinsic size isn't scaled up enough with "object-fit: cover". Reported by schedule dholb.
Read more >
Intrinsic Sizing - SVG
Intrinsic Sizing. Issue 1: Allow graphics to scale even with fixed size. Tools often output:
Read more >
91474 – REGRESSION (r112229): SVG images don't scale ...
... Test Case Updated test case to show that the SVG *content* retains its aspect ratio, but the image element doesn't use the...
Read more >
Fix regression in SVGs with only one of width/height missing (!595 ...
Consider this: <svg xmlns="http://www.w3.org/2000/svg" width="60" viewBox="0 ... So, just produce a size based on the width and the viewBox's aspect ratio.
Read more >
How To Use Aspect-Ratio CSS Property In Responsive Web ...
What is aspect ratio ? · Creating a uniform and responsive SVG design on the web page. · Working with the full viewport...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found