Jpeg decoding when data is specified in an array

I am using the LibJpeg library to decode a jpeg image (given in the form of a byte array) in an rgb color map. but it is different from my sample output, which I want to test with a java program. How to do it using a java program? What is APPn in title? how to decode jpeg image to rgb pixel.

+1
source share
1 answer

Why not use ImageIO.read along with ByteArrayInputStream to read an array of bytes into an image, then no additional library is needed (a purely java solution):

 BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes)); 
+7
source

Source: https://habr.com/ru/post/953327/


All Articles