1

为什么会发生这种情况,我该如何解决?

我要做的就是上传图像并将其保存为 blob。

堆栈跟踪:

17:11:07,613 ERROR [[Upload]] Servlet.service() for servlet Upload threw exception
java.lang.IllegalArgumentException: Numbers of source Raster bands and source color space components do not match
    at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:460)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(JPEGImageReader.java:1235)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1203)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1014)
    at javax.imageio.ImageIO.read(ImageIO.java:1422)
    at javax.imageio.ImageIO.read(ImageIO.java:1326)

ByteArrayInputStream byteStream = new ByteArrayInputStream(value.compLogo);
            BufferedImage bii = ImageIO.read(byteStream);
4

0 回答 0