BufferedImage gettype always returns 0
I have written the following code. My problem is the getType of BufferedImage always returns as 0. I can display the image in the label.
String imgpath = "G:\\eclipse\\DSCN1234.jpg";
File file = new File(imgpath);
BufferedImage img = ImageIO.read(file);
But when I am trying to do the following code it fails due to the prevImage.getType() returns 0. Some body please help.
BufferedImage scaledImage = new BufferedImage(imageW, imageH, );
Graphics2D g2d = scaledImage.createGraphics();