Skip to content

Commit

Permalink
Assume pillow is always available
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Dec 16, 2023
1 parent 484d366 commit 3fb492f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
7 changes: 0 additions & 7 deletions svglib/svglib.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
)
from reportlab.lib import colors
from reportlab.lib.units import pica, toLength
from reportlab.lib.utils import haveImages

try:
from reportlab.graphics.transform import mmult
Expand Down Expand Up @@ -1252,12 +1251,6 @@ def convertPath(self, node):
return gr

def convertImage(self, node):
if not haveImages:
logger.warning(
"Unable to handle embedded images. Maybe the pillow library is missing?"
)
return None

x, y, width, height = self.convert_length_attrs(node, 'x', 'y', 'width', 'height')
image = node._resolved_target
image = Image(int(x), int(y + height), int(width), int(height), image)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from os.path import dirname, splitext, exists, join, basename, getsize
from urllib.parse import quote, unquote, urlparse

from reportlab.lib.utils import haveImages
from reportlab.graphics import renderPDF, renderPM
from reportlab.graphics.shapes import Group, Rect
import pytest
Expand Down Expand Up @@ -414,7 +413,6 @@ def test_convert_pdf_uniconv(self):


class TestOtherFiles:
@pytest.mark.skipif(not haveImages, reason="missing pillow library")
def test_png_in_svg(self):
path = join(TEST_ROOT, "samples", "others", "png_in_svg.svg")
drawing = svglib.svg2rlg(path)
Expand Down

0 comments on commit 3fb492f

Please sign in to comment.