pts / pdfsizeopt

PDF file size optimizer
GNU General Public License v2.0
750 stars 65 forks source link

struct.error: integer out of range for 'L' format code #151

Closed fangkai941104 closed 1 year ago

fangkai941104 commented 3 years ago
info: loaded PNG IDAT of 1081 bytes
info: executing image converter sam2p_pr: sam2p -j:quiet -c zip:15:9 -s Gray1:Gray2:Gray4:Gray8:stop -- psotmp.10679.img-2635.parse.png psotmp.10679.img-2635.sam2p-pr.png
info: loading image from: psotmp.10679.img-2635.sam2p-pr.png
info: loaded PNG IDAT of 2316 bytes
info: optimized image XObject 2635 file_name=None size=1245 (99%) methods=parse-image1:1245,sam2p_np:1246,#orig:1257,parse:2516,sam2p_pr:2523
info: saved 82069 bytes (4%) on optimizable images
Traceback (most recent call last):
  File "/proc/self/exe/runpy.py", line 162, in _run_module_as_main
  File "/proc/self/exe/runpy.py", line 72, in _run_code
  File "./pdfsizeopt.single/__main__.py", line 1, in <module>
  File "./pdfsizeopt.single/m.py", line 6, in <module>
  File "./pdfsizeopt.single/pdfsizeopt/main.py", line 5632, in main
  File "./pdfsizeopt.single/pdfsizeopt/main.py", line 4676, in OptimizeStreams
  File "./pdfsizeopt.single/pdfsizeopt/main.py", line 1984, in GetUncompressedStream
  File "./pdfsizeopt.single/pdfsizeopt/main.py", line 471, in PermissiveZlibDecompress
struct.error: integer out of range for 'L' format code
zvezdochiot commented 3 years ago
--use-pngout=NO
pts commented 1 year ago

I can't reproduce this problem with with other PDF files. Could you please upload your PDF input file?

pts commented 1 year ago

I was able to reproduce this bug. Fixed in 059beae3ef8e767974047c0faedfbdca8cc8b017.