简体   繁体   中英

From JPEG data to a complete JPEG file

I am currently parsing a PDF file using iText, and I encountered an image format which is not supported:

com.itextpdf.text.exceptions.UnsupportedPdfException: The filter /JPXDecode is not supported.

It seems that the information in the raw byte array is JPEG data, without the header information, as the file command line utility indicates:

83.jpg: JPEG 2000 image data

My first idea would be to simple add the header metadata to these files, but I simply don't know how.

How can I add the header metadata to a raw piece of JPEG 2000 data ? A solution using iText would work as well.

The PDF spec (Section 7.4.9 JPXDecode Filter) seems to imply that the byte array is already a fully fledged JPEG2000 file. Have you tried just saving the byte array out to file with .jp2 or jpx extension?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM