错误:javax.imageio.IIOException: Unsupported JPEG process: SOF type 0xc3
错误背景:使用jdk64位、dcm4che-5.11.0版本生成jpg图片,发现dcm传输语义为1.2.840.10008.1.2.4.70(无损压缩格式)就会抛异常,其他显隐式正常;
解决问题历程:
1.网友说需要在
window环境中安装了32位的jdk和jai_imageio-1_0_01-lib-windows-i586-jdk.exe,并没有解决我的问题。。。
2.公司的大神指点,进行以下操作
- a.使用dcm4che-5.16.0的工具包 dcm2jpg.bat 命令可以正常生成jpg图;
- b.下载dcm4che-5.16.0版本的源码,写main方法生成jpg,报错Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java in java.library.path
- c.在dcm4che-5.16.0的工具包dcm4che-5.16.0\lib\win-x86_64目录下有如下文件(根据系统环境选择),将该文件放置到 java.library.path 任意一个路径下,或者是在VM options中设置-Djava.library.path=***\resources\lib\win-x86_64\,生成JPG成功;
- d.在项目中执行时除了需要将opencv_java.dll文件放置到java.library.path以外,需要导入如下jar包,即可;
<!--dcm4che-->
<dependency>
<groupId>org.dcm4che</groupId>
<artifactId>dcm4che-core</artifactId>
<version>5.16.0</version>
</dependency>
<dependency>
<groupId>org.dcm4che</groupId>
<artifactId>dcm4che-image</artifactId>
<version>5.16.0</version>
</dependency>
<dependency>
<groupId>org.dcm4che</groupId>
<artifactId>dcm4che-imageio</artifactId>
<version>5.16.0</version>
</dependency>
<dependency>
<groupId>org.dcm4che</groupId>
<artifactId>dcm4che-imageio-opencv</artifactId>
<version>5.16.0</version>
</dependency>
<dependency>
<groupId>org.weasis.opencv</groupId>
<artifactId>weasis-opencv-core</artifactId>
<version>3.0.4</version>
</dependency>
多亏大神指点