Skip to content

Help: How to deal with color specs of 2 components #1330

@mailsnathaniel

Description

@mailsnathaniel

35618400_3.pdf
Attached PDF file got crashed with the following error message.

Traceback (most recent call last):
File "pdf_extract.py", line 483, in
process_pdf(pdfname, opath, doc_counter, 0)
File "pdf_extract.py", line 422, in process_pdf
getLineAndRectanges(page, reslist, output_path, pageno)
File "pdf_extract.py", line 328, in getLineAndRectanges
fill_opacity=path["opacity"], # opacity parameters
File "/root/VENV/mupdf_1_18_6_venv/lib/python3.6/site-packages/fitz/utils.py", line 3752, in finish
fill_str = ColorCode(fill, "f") # ensure proper fill string
File "/root/VENV/mupdf_1_18_6_venv/lib/python3.6/site-packages/fitz/fitz.py", line 2788, in ColorCode
CheckColor(c)
File "/root/VENV/mupdf_1_18_6_venv/lib/python3.6/site-packages/fitz/fitz.py", line 2780, in CheckColor
raise ValueError("need 1, 3 or 4 color components in range 0 to 1")
ValueError: need 1, 3 or 4 color components in range 0 to 1

System Configurations:

  • Operating system: Ubuntu-18.0
  • Python version: 3.6
  • PyMuPDF version: 1.19.0
    For example, the output of print(sys.version, "\n", sys.platform, "\n", fitz.__doc__) would be sufficient (for the first two bullets).

Metadata

Metadata

Assignees

Labels

not a bugnot a bug / user error / unable to reproduce

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions