Further improvements to image DPI calculation
This commit is contained in:
@@ -52,13 +52,14 @@ def test_dpi_needed(image, text, vector, result, rgb_image, outdir):
|
||||
c.showPage()
|
||||
c.save()
|
||||
|
||||
mock = Mock()
|
||||
mock.oversample = DUMMY_OVERSAMPLE_RESOLUTION[0]
|
||||
|
||||
pi = pdfinfo.PdfInfo(outdir / 'dpi.pdf')
|
||||
pageinfo = pi[0]
|
||||
ctx = Mock()
|
||||
ctx.options.oversample = DUMMY_OVERSAMPLE_RESOLUTION[0]
|
||||
ctx.pageinfo = pageinfo
|
||||
|
||||
assert _pipeline.get_canvas_square_dpi(pi[0], mock) == result
|
||||
assert _pipeline.get_page_square_dpi(pi[0], mock) == result
|
||||
assert _pipeline.get_canvas_square_dpi(ctx) == result
|
||||
assert _pipeline.get_page_square_dpi(ctx) == result
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user