Skip to content

Commit

Permalink
Fix ratio and clip for "image" tags with no size
Browse files Browse the repository at this point in the history
Fix #387.
  • Loading branch information
liZe committed Apr 29, 2023
1 parent 2cbe306 commit 7dea7cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cairosvg/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ def image(surface, node):

node.image_width = image_surface.get_width()
node.image_height = image_surface.get_height()
width = width or node.image_width
height = height or node.image_height
scale_x, scale_y, translate_x, translate_y = preserve_ratio(
surface, node)
surface, node, width, height)

# Clip image region (if necessary)
if not (translate_x == 0 and
Expand Down

0 comments on commit 7dea7cf

Please sign in to comment.