Created attachment 1405882 [details]
Description of problem: When trying to convert pdf to image ( jpeg ), pdftocairo fails to convert it successfully.
Version-Release number of selected component (if applicable): poppler-0.26.5-17.el7_4
How reproducible: Always ( with given test file )
Steps to Reproduce:
1. Download the test file
2. Convert it from pdf to image format using the following command :
$ pdftocairo -jpeg -cropbox -r 360 -scale-to 2401 -x 0 -y 0 -W 2400 -H 2400 <input_file> <output_file>
3. Following errors/messages are seen while conversion in RHEL 7 :
Syntax Error: tcd_decode: incomplete bistream<0a>
Syntax Error: Error in decoding tile<0a>
Syntax Error: Failed to decode J2K image<0a>
Syntax Warning: Did no succeed opening JPX Stream as JP2, trying as J2K.
Syntax Error: 00000000: expected a marker instead of 0<0a>
Syntax Warning: Did no succeed opening JPX Stream as J2K, trying as JPT.
Syntax Error: Forbidden value encounter in message header !!<0a>
Syntax Error: [JPT-stream] : Expecting Main header first [class_Id 0] !<0a>
Syntax Error: Did no succeed opening JPX Stream.
4. Check the output file
Actual results: pdftocairo fails to convert as pdf to images successfully
Expected results: pdftocairo should convert as expected
This is an issue in openjpeg package. I'm able to reproduce the same errors when running "j2k_to_image" on the extracted image.
1) pdfimages -f 1 -l 1 -jp2 test.pdf image
2) copy the result to image.jp2, image.j2k and image.jpt
3) j2k_to_image -i image.jp2 -o image.pgm
4) j2k_to_image -i image.j2k -o image.pgm
5) j2k_to_image -i image.jpt -o image.pgm
I'm reassigning this to openjpeg.
Upstream fix: https://github.com/uclouvain/openjpeg/commit/b42f76cb7f1fefa77d2a38544f904259caf23f26
Created attachment 1417839 [details]
Backported patch from upstream
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.