You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an SVG path that seems to be dropped or discarded from PDF output due to the DPI setting of 96 in weasyprint/images.py:draw(...). If I reduce the DPI even lower, predictably even more paths are discarded from output.
This seems somewhat logical but it's unfortunate that the DPI setting is not configurable.
But now, for a mystery. If I put an import pdb; pdb.set_trace() like so:
defdraw(self, context, concrete_width, concrete_height, _image_rendering):
try:
svg=ScaledSVGSurface(
cairosvg.parser.Tree(
bytestring=self._svg_data, url=self._base_url,
url_fetcher=self._cairosvg_url_fetcher),
output=None, dpi=96, parent_width=concrete_width,
parent_height=concrete_height)
ifsvg.widthandsvg.height:
context.scale(
concrete_width/svg.width, concrete_height/svg.height)
context.set_source_surface(svg.cairo)
# sic !!!importpdb; pdb.set_trace()
context.paint()
exceptExceptionase:
LOGGER.error(
'Failed to draw an SVG image at %s : %s', self._base_url, e)
In this case, the DPI setting seems to be ignored and no paths are discarded at all, no matter the DPI setting.
I have not been able to get any further in understanding this behavior.
The text was updated successfully, but these errors were encountered:
It's proably a duplicate of #278 / #339 / #431 / #438… Short answer: it's a bug in cairo fixed upstream since April 2016, but no stable version has the patch. You can use the unstable 1.15.6 version for example.
I have an SVG path that seems to be dropped or discarded from PDF output due to the DPI setting of 96 in
weasyprint/images.py:draw(...)
. If I reduce the DPI even lower, predictably even more paths are discarded from output.This seems somewhat logical but it's unfortunate that the DPI setting is not configurable.
But now, for a mystery. If I put an
import pdb; pdb.set_trace()
like so:In this case, the DPI setting seems to be ignored and no paths are discarded at all, no matter the DPI setting.
I have not been able to get any further in understanding this behavior.
The text was updated successfully, but these errors were encountered: