digidigital / OCRthyPDF-Essentials

Make your PDF files text-searchable (A GUI for OCRmyPDF)
GNU Affero General Public License v3.0
32 stars 3 forks source link

ocrmypdf returns error "invalid arguments" #22

Closed WAKIGA98 closed 4 months ago

WAKIGA98 commented 5 months ago

I've used OCRthyPDF for about two years, last time on Monday. Today (Sunday), the software returns an error message. During the last week there has been a system update. "start OCR" of any pdf file returns the error.

OS: Ubuntu 22.04.4 LTS

Running on CMD with DEBUG:

INFO:OCRthyPDF:OCR job started/home/..../name.pdf DEBUG:OCRthyPDF:Job Exit-Code: Invalid arguments, exited with an error. INFO:OCRthyPDF:Cleanup complete.

Output in "Console":

ocrmypdf --use-threads -l deu -l eng --skip-text --tesseract-thresholding otsu --rotate-pages --rotate-pages-threshold 15 --optimize 1 --output-type pdfa-2 name.pdf name_OCR.pdf

Traceback (most recent call last):

File "/snap/ocrthypdf/161/bin/ocrmypdf", line 5, in

from ocrmypdf.__main__ import run

File "/snap/ocrthypdf/161/lib/python3.9/site-packages/ocrmypdf/init.py", line 10, in

from ocrmypdf import helpers, hocrtransform, pdfa, pdfinfo

File "/snap/ocrthypdf/161/lib/python3.9/site-packages/ocrmypdf/pdfinfo/init.py", line 9, in

from ocrmypdf.pdfinfo.info import Colorspace, Encoding, PageInfo, PdfInfo

File "/snap/ocrthypdf/161/lib/python3.9/site-packages/ocrmypdf/pdfinfo/info.py", line 23, in

from pikepdf import (

ImportError: cannot import name 'PdfMatrix' from 'pikepdf' (/snap/ocrthypdf/161/lib/python3.9/site-packages/pikepdf/init.py)

Invalid arguments, exited with an error.

digidigital commented 5 months ago

Thx for reporting the issue. It seems pikepdf got an update and removed the 'PdfMatrix' I set the pikepdf-version to v8.15.1 and the issue should be gone.

...might be a good idea to switch the base snap to core24 (based on 24.04 LTS) in order to be able to use all the latest dependencies. Maybe I start the migration next weekend.

digidigital commented 5 months ago

Issue should be fixed with SNAP-release:
latest/stable | 16 Jun 24 Revision: 162 Version: v0.7.0-62-g6b8e7c4 Build: lp-89838965

WAKIGA98 commented 4 months ago

Thank you very much! I run the update and problem fixed.