当我尝试调整图像大小时,我收到一个异常消息“java.lang.IllegalStateException:给定格式没有 ImageReader”。
public static void main(String... args) throws Exception {
IMOperation op = new IMOperation();
op.addImage();
op.resize(350)
op.addImage()
BufferedImage images = ImageIO.read(new File("image.jpg"));
// set up command
ConvertCmd convert = new ConvertCmd();
Stream2BufferedImage s2b = new Stream2BufferedImage();
convert.setOutputConsumer(s2b);
// run command and extract BufferedImage from OutputConsumer
convert.run(op,images);
BufferedImage img = s2b.getImage();
}