New port: graphics/py-img2pdf

This Python package provides lossless conversion of raster images to PDF. You
should use img2pdf if your priorities are (in this order):

1. "always lossless": The image embedded in the PDF will always have the exact
   same color information for every pixel as the input.

2. "small": If possible, the difference in filesize between the input image and
   the output PDF will only be the overhead of the PDF container itself.

3. "fast": If possible, the input image is just pasted into the PDF document
   as-is without any CPU hungry re-encoding of the pixel data.

Conventional conversion software (like ImageMagick) would either:

1. Not be lossless because lossy re-encoding to JPEG.
2. Not be small because using wasteful flate encoding of raw pixel data.
3. Not be fast because input data gets re-encoded.

Another advantage of not having to re-encode the input (in most common
situations) is, that img2pdf is able to handle much larger input than other
software, because the raw pixel data never has to be loaded into memory.

WWW: https://gitlab.mister-muffin.de/josch/img2pdf
This commit is contained in:
Kai Knoblich
2019-07-02 07:19:56 +00:00
parent 4cb63e145e
commit a7be37217d
4 changed files with 56 additions and 0 deletions

View File

@@ -842,6 +842,7 @@
SUBDIR += py-imageio-ffmpeg
SUBDIR += py-imageio24
SUBDIR += py-imagesize
SUBDIR += py-img2pdf
SUBDIR += py-imgurpython
SUBDIR += py-leather
SUBDIR += py-mapclassify

View File

@@ -0,0 +1,29 @@
# $FreeBSD$
PORTNAME= img2pdf
DISTVERSION= 0.3.3
CATEGORIES= graphics python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= kai@FreeBSD.org
COMMENT= Convert images to PDF via direct JPEG inclusion
LICENSE= LGPL3+
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR} \
${PY_ENUM34}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pdfrw>0:textproc/py-pdfrw@${PY_FLAVOR}
USES= python
USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
# Note: The tests only work with Python 3, see also:
# https://gitlab.mister-muffin.de/josch/img2pdf/issues/60
do-test:
@(cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test)
.include <bsd.port.mk>

View File

@@ -0,0 +1,3 @@
TIMESTAMP = 1558438909
SHA256 (img2pdf-0.3.3.tar.gz) = 9d77c17ee65a736abe92ef8cba9cca009c064ea4ed74492c01aea596e41856cf
SIZE (img2pdf-0.3.3.tar.gz) = 80523

View File

@@ -0,0 +1,23 @@
This Python package provides lossless conversion of raster images to PDF. You
should use img2pdf if your priorities are (in this order):
1. "always lossless": The image embedded in the PDF will always have the exact
same color information for every pixel as the input.
2. "small": If possible, the difference in filesize between the input image and
the output PDF will only be the overhead of the PDF container itself.
3. "fast": If possible, the input image is just pasted into the PDF document
as-is without any CPU hungry re-encoding of the pixel data.
Conventional conversion software (like ImageMagick) would either:
1. Not be lossless because lossy re-encoding to JPEG.
2. Not be small because using wasteful flate encoding of raw pixel data.
3. Not be fast because input data gets re-encoded.
Another advantage of not having to re-encode the input (in most common
situations) is, that img2pdf is able to handle much larger input than other
software, because the raw pixel data never has to be loaded into memory.
WWW: https://gitlab.mister-muffin.de/josch/img2pdf