Skip to content

Commit

Permalink
add test for text autofit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcupitt committed Dec 21, 2019
1 parent 1e2ca2e commit 981ffe7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test-suite/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ def test_text(self):
assert im.max() == 255
assert im.min() == 0

# test autofit
im = pyvips.Image.text("Hello, world!", width=500, height=500)
assert abs(im.width - 500) < 10

This comment has been minimized.

Copy link
@kleisauke

kleisauke Dec 26, 2019

Member

On Windows this testcase seems to fail (tested with v8.9.0-rc2). Here's the output:
x.jpg (dimensions: 471x317)

Perhaps we could increase the tolerance to < 30?

This comment has been minimized.

Copy link
@jcupitt

jcupitt Dec 26, 2019

Author Member

Good idea -- I just picked 10 randomly :(


def test_tonelut(self):
im = pyvips.Image.tonelut()
assert im.bands == 1
Expand Down

0 comments on commit 981ffe7

Please sign in to comment.