Skip to content

Commit 3fb492f

Browse files
committed
Assume pillow is always available
Also read https://groups.google.com/g/reportlab-users/c/ipYLOar7KcI
1 parent 484d366 commit 3fb492f

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

svglib/svglib.py

-7
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
)
3737
from reportlab.lib import colors
3838
from reportlab.lib.units import pica, toLength
39-
from reportlab.lib.utils import haveImages
4039

4140
try:
4241
from reportlab.graphics.transform import mmult
@@ -1252,12 +1251,6 @@ def convertPath(self, node):
12521251
return gr
12531252

12541253
def convertImage(self, node):
1255-
if not haveImages:
1256-
logger.warning(
1257-
"Unable to handle embedded images. Maybe the pillow library is missing?"
1258-
)
1259-
return None
1260-
12611254
x, y, width, height = self.convert_length_attrs(node, 'x', 'y', 'width', 'height')
12621255
image = node._resolved_target
12631256
image = Image(int(x), int(y + height), int(width), int(height), image)

tests/test_samples.py

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from os.path import dirname, splitext, exists, join, basename, getsize
2222
from urllib.parse import quote, unquote, urlparse
2323

24-
from reportlab.lib.utils import haveImages
2524
from reportlab.graphics import renderPDF, renderPM
2625
from reportlab.graphics.shapes import Group, Rect
2726
import pytest
@@ -414,7 +413,6 @@ def test_convert_pdf_uniconv(self):
414413

415414

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

0 commit comments

Comments
 (0)