You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IndexError: list index out of range in export_image function when accessing filters[-1][0] due to an empty or improperly structured filters list.
#1052
encountered an IndexError in the export_image function of pdfminer, specifically in this line: if filters[-1][0] in LITERALS_DCT_DECODE:
The error occurs when attempting to access filters[-1][0], which fails when filters is either empty or not structured as expected. Please investigate if there should be additional checks to handle these cases gracefully.
Traceback
Traceback (most recent call last):\n File "/usr/src/python-app/processor/pdf_processor.py", line 114, in __get_image_raw_data\n file_name = image_writer.export_image(image=image)\n File "/opt/conda/envs/env/lib/python3.9/site-packages/pdfminer/image.py", line 108, in export_image\n if filters[-1][0] in LITERALS_DCT_DECODE:\nIndexError: list index out of range
Bug report
if filters[-1][0] in LITERALS_DCT_DECODE:
Traceback
Traceback (most recent call last):\n File "/usr/src/python-app/processor/pdf_processor.py", line 114, in __get_image_raw_data\n file_name = image_writer.export_image(image=image)\n File "/opt/conda/envs/env/lib/python3.9/site-packages/pdfminer/image.py", line 108, in export_image\n if filters[-1][0] in LITERALS_DCT_DECODE:\nIndexError: list index out of range
attaching the pdf used
vietnam.pdf
@pietermarsman please review
The text was updated successfully, but these errors were encountered: