Remove shim for img2pdf < 0.4.4

This commit is contained in:
James R. Barlow
2023-09-21 00:05:39 -07:00
parent de2bb5ce8c
commit e8c82ee4b6
2 changed files with 2 additions and 10 deletions
+1 -9
View File
@@ -19,18 +19,10 @@ from typing import Any, Generic, Sequence, SupportsFloat, SupportsRound, TypeVar
import img2pdf
import pikepdf
from packaging.version import Version
log = logging.getLogger(__name__)
if Version(img2pdf.__version__) < Version('0.4.0'):
IMG2PDF_KWARGS = dict(without_pdfw=True)
elif Version(img2pdf.__version__) < Version('0.4.3'):
IMG2PDF_KWARGS = dict(engine=img2pdf.Engine.pikepdf)
else:
IMG2PDF_KWARGS = dict(
engine=img2pdf.Engine.pikepdf, rotation=img2pdf.Rotation.ifvalid
)
IMG2PDF_KWARGS = dict(engine=img2pdf.Engine.pikepdf, rotation=img2pdf.Rotation.ifvalid)
T = TypeVar('T', bound=SupportsRound[Any])