[英]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: 我目前正在使用iText解析PDF文件,并且遇到不支持的图像格式:
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: 似乎原始字节数组中的信息是JPEG数据,没有标题信息,如
file
命令行实用程序指示的那样:
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 ? 如何将标头元数据添加到JPEG 2000原始数据中? A solution using iText would work as well.
使用iText的解决方案也可以使用。
The PDF spec (Section 7.4.9 JPXDecode Filter) seems to imply that the byte array is already a fully fledged JPEG2000 file. PDF规范(第7.4.9节JPXDecode过滤器)似乎暗示字节数组已经是完整的JPEG2000文件。 Have you tried just saving the byte array out to file with .jp2 or jpx extension?
您是否尝试过仅将字节数组保存到扩展名为.jp2或jpx的文件中?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.