It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

problem with reading .bmp file

problem with reading .bmp file

Postby raddic on Tue Apr 24, 2007 9:23 am

Currently I'm using imageIO.read() to read image files but it seems not to be working for bmp files.


BufferedImage strawImage = ImageIO.read(new File("strawberry.jpg"));
if(strawImage == null) System.out.println ("Image jpg read error");


BufferedImage appleImage = ImageIO.read(new File("apple.bmp"));
if(appleImage == null) System.out.println ("Image bmp read error");


it returns "Image bmp read error", which means it read the jpg, but not the bmp. I tried displaying them as Frame, and jpg shows up well, while bmp doesn't.

Does anyone know why? :( I'm stuck plz help me~
raddic
 
Posts: 0
Joined: Tue Apr 24, 2007 9:16 am

Postby marecki6000 on Sat May 05, 2007 4:28 pm

Hi Raddic

I don't know exactly, how it is with new version of java.
Previous versions were supporting JPEG, GIF and PNG formats only
Maybe you will find a proper library to load BMP images here:
http://schmidt.devlib.org/java/pixel-im ... aries.html

Regards
Marecki
marecki6000
 
Posts: 6
Joined: Thu Apr 26, 2007 10:18 pm


Who is online

Users browsing this forum: No registered users and 1 guest