Convert Byte Array to image in Java - without knowing the type

后端 未结 3 2097
轮回少年
轮回少年 2020-12-06 10:50

Sounds simple right? Use

ImageIO.read(new ByteArrayInputStream(bytes));

Here\'s the wrinkle. For some reason it is detecting a jpeg as a b

3条回答
  •  眼角桃花
    2020-12-06 11:23

    Is the BMP reader the only one returned by getImageReaders()? Maybe you get more than one and can make a choice based on that.

提交回复
热议问题