-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Explanation
At the moment, support for the /DeviceRGB color mode seems to be missing:
File "/home/user/lib/python3.6/site-packages/pypdf/_page.py", line 2604, in __iter__
yield self[i]
File "/home/user/lib/python3.6/site-packages/pypdf/_page.py", line 2600, in __getitem__
return self.get_function(lst[index])
File "/home/user/lib/python3.6/site-packages/pypdf/_page.py", line 533, in _get_image
return self._get_image(ids, cast(DictionaryObject, xobjs[id[0]]))
File "/home/user/lib/python3.6/site-packages/pypdf/_page.py", line 522, in _get_image
imgd = _xobj_to_image(cast(DictionaryObject, xobjs[id]))
File "/home/user/lib/python3.6/site-packages/pypdf/filters.py", line 877, in _xobj_to_image
"",
File "/home/user/lib/python3.6/site-packages/pypdf/filters.py", line 693, in _get_imagemode
mode_map.get(color_space) # type: ignore
TypeError: unhashable type: 'ArrayObject'
Debugging the value of color_space reveals ['/DeviceRGB'].
Code Example
from pypdf import PdfReader
reader = PdfReader('file.pdf')
for page in reader.pages:
for image in reader.images:
print(image)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels