Commit graph

40 commits

Author SHA1 Message Date
ceba6a8223
Rip out remaining python3 support
https://www.enricozini.org/blog/2020/python/python-2-is-dead/
2020-04-23 07:13:39 +02:00
0bbbc7a31a
pdfrw is now disabled by default if it's not installed (closes: #74) 2020-04-23 06:59:07 +02:00
Georg Sauthoff
2faeb2005d
Decompress stream to account for different possible encodings (closes: #51)
Recompressing the image stream makes the comparison robust against output
preserving changes in the zlib compress output bitstream
(e.g. between different zlib implementations/versions/releases).
Without this, some img2pdf 0.3.2 tests fail on Fedora 29/aarch64.
See also:
josch/img2pdf#51
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/R7GD4L5Z6HELCDAL2RDESWR2F3ZXHWVX/
2018-12-24 18:13:49 +01:00
0639dbd47c
src/tests/__init__.py: fix CommandLineTests on python3 2018-12-24 18:04:40 +01:00
josch
4cebd9f15d Merge branch 'agroszer-py2' into 'master'
fixing a slew of python 2 issues

See merge request !4
2018-12-11 17:16:50 +00:00
198c98a5f9
make pep8 compliant 2018-08-01 22:28:44 +02:00
f5d8d86dff
Also do not re-encode CCITT Group 4 encoded TIFF images
Add additional property of input images: inverted

closes: #47
2018-08-01 22:12:40 +02:00
2ad0c036b2
src/tests/input/mono.tif: set dpi to 72 2018-07-18 14:08:04 +02:00
eec1a25a92
add test case for ccittfaxdecode 2018-07-18 01:55:48 +02:00
7de174f4b5
CCITTFaxDecode filter must be in an array 2018-07-18 01:55:48 +02:00
d931f02709
src/tests/__init__.py: handle PNG input images properly 2018-07-18 00:05:15 +02:00
b99fae1380
src/tests/__init__.py: don't test for color space now that we support palette PNGs 2018-07-18 00:04:30 +02:00
ac9ba1d0f6
handle monochrome png properly 2018-07-18 00:03:31 +02:00
eaf9de23c9
Filter must not be array for PNG output, so never make it an array 2018-07-17 23:59:55 +02:00
2a33ff275d
adapt test output to new handling of png input 2018-07-17 23:56:01 +02:00
ebd8d911bb
add test grayscale input png src/tests/input/gray.png 2018-07-17 16:57:44 +02:00
e7755f0a87
src/tests/input/normal.png: remove alpha channel 2018-07-17 16:57:44 +02:00
3142824bab
src/tests/__init__.py: do not test animation.gif with pdfrw because it doesn't support hexadecimal palette data 2018-07-17 16:57:44 +02:00
James R. Barlow
a8269391e9 Implement /UserUnit scaling to support oversized PDFs
The original PDF specification supported a maximum of 200x200" pages or
14400 PDF units. In PDF 1.6 rather than remove this limitation, Adobe
added the /UserUnit field for pages, which allows one to specify the
scaling that should be applied for user-facing numbers, while keeping
the internal limit of 14400 units.

Many real-world designs are larger than 200" in one direction. One
example is tractor feed or rolled paper which may be easier to scan in
one continuous run rather than segment into pages.

/UserUnit is independent of the pixel size and resolution of the image.

/UserUnit can also indicate very small page sizes but this is not
implemented here.
2017-08-20 21:19:23 +09:00
Adam Groszer
0e76a5bd97 fixing a slew of python 2 issues 2017-08-07 11:21:42 +02:00
Stephan Richter
b25098c3f0 Python 2 does not automatically convert integers to floats, so we have to be a bit more explicit. 2017-05-22 19:34:34 +02:00
Stephan Richter
18d637ea34 Make sure we are using the correct IO class in Python 2. 2017-05-22 12:31:52 -04:00
16993964ce restore pep8 compliance 2017-01-20 09:19:30 +01:00
60b2e2206a Add multiframe gif (animated gif) test case 2017-01-20 08:48:16 +01:00
8476e333cd src/tests/__init__.py: add support for multiframe gif tests 2017-01-20 08:47:58 +01:00
e4b6854eb5 src/tests/output/mono.png.pdf: remove the /Producer field 2017-01-20 04:45:30 +01:00
962d4dbdfb Make pep8 compliant again 2017-01-19 11:22:08 +01:00
c2f43a579e src/tests/output/mono.png.pdf: remove timestamps 2017-01-19 09:02:16 +01:00
James R. Barlow
eedf73e73e Add test cases for CCITT G4 2016-07-22 07:09:35 +02:00
e05d2992e0 src/tests/__init__.py: adapt testcases for last commit 2016-05-26 18:11:42 +02:00
27015c1a6e fix testsuite after exception renaming 2016-02-17 00:26:45 +01:00
josch
251238b410 release version 0.2.0 - big rewrite and lots of new features
- now Python3 only
 - pep8 compliant code
 - update my email to josch@mister-muffin.de
 - move from github to gitlab.mister-muffin.de/josch/img2pdf
 - use logging module
 - add extensive test suite
 - ability to read from standard input
 - pdf writer:
      - make more compatible with the interface of pdfrw module
      - print floats which equal to their integer conversion as integer
      - do not print trailing zeroes for floating point numbers
      - print more linebreaks
      - add binary string at beginning of PDF to indicate that the PDF
        contains binary data
      - handle datetime and unicode strings by using utf-16-be encoding
 - new options (see --help for more details):
      - --without-pdfrw
      - --imgsize
      - --border
      - --fit
      - --auto-orient
      - --viewer-panes
      - --viewer-initial-page
      - --viewer-magnification
      - --viewer-page-layout
      - --viewer-fit-window
      - --viewer-center-window
      - --viewer-fullscreen
 - remove short command line options for metadata arguments
2016-02-02 19:51:27 +01:00
josch
d5fc324b7b cater for python-pil versions without close() attribute (the 3rd fix) 2015-03-07 03:02:00 +01:00
josch
b90e385efe cater for python-pil versions without close() attribute (the 2nd fix) 2015-03-07 03:01:02 +01:00
josch
9389d81a14 fix testsuite after commit 2cb8e55f broke it - thanks Jakub Wilk! 2015-03-06 23:55:32 +01:00
Jakub Wilk
5d7975164d remove unused imports 2015-03-06 22:51:58 +01:00
josch
aabd104114 update tests handling 2015-02-16 19:23:21 +01:00
josch
3fdd824201 support file objects as input 2015-02-16 14:49:29 +01:00
Erik Jensen
c68ce6a48d Add CMYK test images 2015-02-16 07:09:38 +01:00
Stephan Richter
db7e74bcfe Added tests for the package. 2014-03-14 19:18:38 +01:00