STRIP_SIZE messages #193

Open
opened 2024-03-05 09:13:15 +00:00 by MrMacvos · 4 comments

Since a while I'm getting these messages in my logs:

Array
(
    [0] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [1] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [2] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [3] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [4] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [5] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [6] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [7] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [8] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [9] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [10] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [11] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [12] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [13] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [14] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [15] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [16] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [17] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [18] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [19] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [20] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170
    [21] ...

It is one message per image to be converted to a PDF-page.

Do I have to do something?
Should I use the --pillow-limit-break parameter?
Can I simply suppress these, and if so, how? I don't use -v so they should nt appear unless it's an error.

Since a while I'm getting these messages in my logs: ``` Array ( [0] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [1] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [2] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [3] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [4] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [5] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [6] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [7] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [8] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [9] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [10] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [11] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [12] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [13] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [14] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [15] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [16] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [17] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [18] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [19] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [20] => setting <module 'PIL.TiffImagePlugin' from '/usr/lib64/python3.11/site-packages/PIL/TiffImagePlugin.py'>.STRIP_SIZE = 1087170 [21] ... ``` It is one message per image to be converted to a PDF-page. Do I have to do something? Should I use the `--pillow-limit-break` parameter? Can I simply suppress these, and if so, how? I don't use `-v` so they should nt appear unless it's an error.
Owner

Thank you for your report!
What logs are you seeing these messages in? Just on standard output when you run img2pdf?
I'm not sure why there is anything printed when img2pdf sets the tiff strip size. This is harmless and there should not be any warning about that.

Thank you for your report! What logs are you seeing these messages in? Just on standard output when you run img2pdf? I'm not sure why there is anything printed when img2pdf sets the tiff strip size. This is harmless and there should not be any warning about that.
Author

Yes, I think stdout. It doesn't say.

I have a shell script which logs output and that script is called by a PHP-script, which in turn logs the output to a database.
I have queries that rely on the first line of the output, and that line have been 'taken over' by these PIL-messages.

I write my logging into a shell-script variable, which I echo at the end, after img2pdf. So .. img2pdf produces these messages and then, after the loop, I echo my log variable.

This is how my img2pdf command looks like:

img2pdf -o "${zzpath}/${jx}.pdf" "${zzpath}/${jx}"_*"${zzextnew}"*

The input can be 1 image, or 20+ images.

The system this is happening on: Fedora Linux 38, Linux 6.6.6-100.fc38.x86_64 on x86_64 with img2pdf 0.4.4.

Yes, I think stdout. It doesn't say. I have a shell script which logs output and that script is called by a PHP-script, which in turn logs the output to a database. I have queries that rely on the first line of the output, and that line have been 'taken over' by these PIL-messages. I write my logging into a shell-script variable, which I echo at the end, after img2pdf. So .. img2pdf produces these messages and then, after the loop, I echo my log variable. This is how my img2pdf command looks like: ``` img2pdf -o "${zzpath}/${jx}.pdf" "${zzpath}/${jx}"_*"${zzextnew}"* ``` The input can be 1 image, or 20+ images. The system this is happening on: `Fedora Linux 38`, `Linux 6.6.6-100.fc38.x86_64 on x86_64` with `img2pdf 0.4.4`.
Owner

I don't understand how you get the output you describe with the command you are running. The messages you see are created by this line in the code:

logger.debug(f"setting {self.obj}.{self.field} = {self.value}")

So why are you getting these messages without running img2pdf with --verbose? Hrm....

I don't understand how you get the output you describe with the command you are running. The messages you see are created by this line in the code: logger.debug(f"setting {self.obj}.{self.field} = {self.value}") So why are you getting these messages without running img2pdf with --verbose? Hrm....
Author

I also got this error message on macOS Sonoma after a brew upgrade:

$ img2pdf
Traceback (most recent call last):
  File "/usr/local/bin/img2pdf", line 5, in <module>
    from img2pdf import main
  File "/usr/local/lib/python3.8/site-packages/img2pdf.py", line 25, in <module>
    from PIL import Image, TiffImagePlugin
  File "/usr/local/lib/python3.8/site-packages/PIL/Image.py", line 109, in <module>
    from . import _imaging as core
ImportError: dlopen(/usr/local/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so, 0x0002): Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib
  Referenced from: <5E7CA10E-405C-3642-AED0-ED03B73302EE> /usr/local/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so
  Reason: tried: '/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/usr/local/lib/libtiff.5.dylib' (no such file), '/usr/lib/libtiff.5.dylib' (no such file, not in dyld cache), '/usr/local/Cellar/libtiff/4.6.0/lib/libtiff.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/libtiff/4.6.0/lib/libtiff.5.dylib' (no such file), '/usr/local/Cellar/libtiff/4.6.0/lib/libtiff.5.dylib' (no such file), '/usr/local/lib/libtiff.5.dylib' (no such file), '/usr/lib/libtiff.5.dylib' (no such file, not in dyld cache)

Somewhere on Google I found user's using SUMO (https://github.com/eclipse-sumo/sumo/issues/13147) having the same problem. One suggestion was to copy libtiff.6.dylib to libtiff.5.dylib, which I did. That seems to have resolved the issue.

I also got this error message on macOS Sonoma after a `brew upgrade`: ``` $ img2pdf Traceback (most recent call last): File "/usr/local/bin/img2pdf", line 5, in <module> from img2pdf import main File "/usr/local/lib/python3.8/site-packages/img2pdf.py", line 25, in <module> from PIL import Image, TiffImagePlugin File "/usr/local/lib/python3.8/site-packages/PIL/Image.py", line 109, in <module> from . import _imaging as core ImportError: dlopen(/usr/local/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so, 0x0002): Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib Referenced from: <5E7CA10E-405C-3642-AED0-ED03B73302EE> /usr/local/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so Reason: tried: '/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/usr/local/lib/libtiff.5.dylib' (no such file), '/usr/lib/libtiff.5.dylib' (no such file, not in dyld cache), '/usr/local/Cellar/libtiff/4.6.0/lib/libtiff.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/libtiff/4.6.0/lib/libtiff.5.dylib' (no such file), '/usr/local/Cellar/libtiff/4.6.0/lib/libtiff.5.dylib' (no such file), '/usr/local/lib/libtiff.5.dylib' (no such file), '/usr/lib/libtiff.5.dylib' (no such file, not in dyld cache) ``` Somewhere on Google I found user's using SUMO (https://github.com/eclipse-sumo/sumo/issues/13147) having the same problem. One suggestion was to copy `libtiff.6.dylib` to `libtiff.5.dylib`, which I did. That seems to have resolved the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#193
No description provided.