Open macdeport opened 6 months ago
Most of these errors are harmless and mainly says that a particular image cannot be optimized because it's defined in terms of production printing (e.g. CMYK+) rather than RGB. Of course, it would be cleaner to log this fact, instead of logging an exception. I will have to make that change.
The error message at the end
Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
suggests that there is some corruption in the PDF - I'd check it with a viewer to ensure all images look fine visually.
I also got a similar error (actually, the same error thousands of times in the same PDF):
xref 12157: While extracting this image, an error occurred optimize.py:327
Traceback (most recent call last):
File "C:\Program Files\Python312\Lib\site-packages\ocrmypdf\optimize.py", line 323, in extract_images
result = extract_fn(
^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\ocrmypdf\optimize.py", line 215, in
extract_image_generic
elif not pim.indexed and pim.colorspace in pim.SIMPLE_COLORSPACES:
^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\pikepdf\models\image.py", line 210, in colorspace
raise NotImplementedError(
NotImplementedError: not sure how to get colorspace: ['/Separation', '/Black', '/DeviceCMYK',
pikepdf.Dictionary({
"/C0": [ 0, 0, 0, 0 ],
"/C1": [ 0, 0, 0, 1 ],
"/Domain": [ 0, 1 ],
"/FunctionType": 2,
"/N": 1,
"/Range": [ 0, 1, 0, 1, 0, 1, 0, 1 ]
})]
Glad to hear that it is harmless. Hoping for a change to make this less scary.
Describe the bug
Rare error on an Adobe InDesign 18.0 file (Macintosh)
Steps to reproduce
Files
bid.pdf
How did you download and install the software?
MacPorts
OCRmyPDF version
ocrmypdf 16.2.0
Relevant log output