JAI 供应商名称 == 空
因此,我完成了应用程序编码以旋转TIFF图像,这需要JAI来操作TIFF。
在Eclipse下工作时,它可以正常工作,但是每当我为库构建一个胖jar,然后创建一个实现它(根据 http://fjep.sourceforge.net/fjeptutorial.html)时,当我执行java -jar Push.jar\path\to\dir时,它就会一直运行,直到它到达它正在压缩和保存的部分:
TIFFImageWriterSpi tiffspi = new TIFFImageWriterSpi();
ImageWriter writer = tiffspi.createWriterInstance();
//Iterator<ImageWriter> iter = ImageIO.getImageWritersByFormatName("TIFF");
//ImageWriter writer = iter.next();
ImageWriteParam param2 = writer.getDefaultWriteParam();
param2.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param2.setCompressionType("LZW");
param2.setCompressionQuality(0.0f);
File fOutputFile = workArea[i];
ImageOutputStream ios = ImageIO.createImageOutputStream(fOutputFile);
writer.setOutput(ios);
if (frontPage == 1)
{
writer.write(null, new IIOImage(pg1, null, null), param2);
writer.writeInsert(-1, new IIOImage(pg2, null, null), param2);
}
else if (frontPage == 2)
{
writer.write(null, new IIOImage(pg2, null, null), param2);
writer.writeInsert(-1, new IIOImage(pg1, null, null), param2);
}
remaining = remaining - 1;
if (remaining > 0)
System.out.println(remaining + " remaining.");
else
System.out.println("Done.");
它在该部分的第一行上爆炸,并显示以下消息:
Exception in thread "main" java.lang.IllegalArgumentException: vendorName == null!
....rest of stack trace.