josch commented on issue josch/img2pdf#146 2022-07-02 19:20:51 +00:00
Accept pathlib objects in addition to strings

You don't hve to convert them with str(). You can either:

  • call pathlib.Path.open() and pass the resulting object to img2pdf (but don't forget to close the resulting object)
  • call…
josch pushed to main at josch/img2pdf 2022-07-02 19:19:45 +00:00
272fe0433f allow pathlib.Path objects by allowing objects implementing read_bytes function
josch pushed to main at josch/img2pdf 2022-07-02 18:39:27 +00:00
ef7b9e739d add miff tests for cmyk8 and rgb8
josch pushed to main at josch/img2pdf 2022-06-28 14:56:14 +00:00
c857f1c748 add miff tests for cmyk8 and rgb8
josch commented on issue josch/img2pdf#144 2022-06-28 13:23:51 +00:00
16 bit TIFF file

@mara0004 thank you for your input -- i've reverted the match/case usage for now: af6fe27d53476fe68d43b11766651a6637a098a7

josch pushed to main at josch/img2pdf 2022-06-28 13:22:22 +00:00
af6fe27d53 avoid match/case for now until python 3.10 is available on more platforms
josch pushed to main at josch/img2pdf 2022-06-28 13:21:45 +00:00
b804f6fe80 avoid match/case for now until python 3.10 is available on more platforms
josch commented on issue josch/img2pdf#144 2022-06-27 16:12:44 +00:00
16 bit TIFF file

@mara0004 yeah i'm still thinking about that bit. The match/case syntax is a feature i've waited for since i started using python a decade ago so i'm really eager to use it now. I'm not sure…

josch commented on issue josch/img2pdf#144 2022-06-27 12:23:11 +00:00
16 bit TIFF file

thank you for your feedback!

i committed the preliminary MIFF support to main and will add more test cases later but your use-case of 16bit CMYK should be covered already so have fun! :)

josch closed issue josch/img2pdf#144 2022-06-27 12:22:30 +00:00
16 bit TIFF file
josch pushed to main at josch/img2pdf 2022-06-27 12:22:30 +00:00
bad6fcae39 support for MIFF which allows 16 bit CMYK images
josch pushed to main at josch/plakativ 2022-06-27 08:11:02 +00:00
8d00b730f1 also replace getPixmap by get_pixmap and getImageData by tobytes
josch pushed to main at josch/plakativ 2022-06-26 22:04:52 +00:00
c50b44a3a0 use new snake_case naming for pymupdf 1.19.0 and later
josch commented on issue josch/img2pdf#144 2022-06-26 11:34:03 +00:00
16 bit TIFF file

Something about your TIFF file seems odd. When I run tifftopnm from netpbm I get the following message:

tifftopnm: This color separation file uses an inkset (41712) we can't handle.  We…
josch commented on issue josch/img2pdf#144 2022-06-26 09:14:24 +00:00
16 bit TIFF file

The code above works with all my MIFF test cases. Now I just need a 16 bit CMYK MIFF image. If I try to convert your testCMYK.tif to MIFF using convert I get:

convert-im6.q16: Sorry, can…
josch commented on issue josch/img2pdf#144 2022-06-26 08:20:48 +00:00
16 bit TIFF file

Here is a MIFF parser:

import glob
import re
import zlib

line_re = re.compile(
    r"""
    [^\x00-\x20\x7f-\x9f] # the field name must not start with a control char or space
josch commented on issue josch/img2pdf#145 2022-06-24 10:50:28 +00:00
non-ASCII characters in --producer metadata field breaks app

thank you for your bug report!

unfortunately I'm unable to reproduce your problem on debian stable. the error you cite sounds like a python2 error but img2pdf in debian stable uses python3.

a…

josch commented on issue josch/img2pdf#144 2022-06-16 21:43:32 +00:00
16 bit TIFF file

A non-standard ink set... At which point should I get worried what people are doing with my software? :D

So I guess you want to convert your tiff into pdf because pdf is what you send to your…

josch commented on issue josch/img2pdf#144 2022-06-16 18:22:01 +00:00
16 bit TIFF file

Hrm... yeah parsing MIFF is an option but I don't really like splitting off a imagemagick process to create the MIFF. This will be very platform specific. Your problem is also that you need CMYK…

josch commented on issue josch/img2pdf#144 2022-06-16 11:10:06 +00:00
16 bit TIFF file

Can you share your input tif image? How did you create it?

Here is a PIL issue about this: https://github.com/python-pillow/Pillow/issues/1888

Either this limitation of PIL gets fixed or we…