I get a Base64Encoded image string (GIF format) from an external system. While reading the byte array and saving the image to file, the image gets saved in landscape orientation.
The code snippet is below.
String image = "R0lGODdhCAcgA=";
Base64Coder decoder = new Base64Coder();
byte [] decodeBytes = decoder.decode(image.getBytes());
ByteArrayInputStream stream = new ByteArrayInputStream(pngArray);
BufferedImage bImage = ImageIO.read(stream);
File label = new File("C:/labels/test.gif");
ImageIO.write(bImage, "gif", label);
I want to save the image in portrait orientation. Is there a way to do that?