Corrupted images using ImageIO.read.

I have looked around and it seems to be a lot of confusion about the point that the corruption occurs. After trying a lot of thing I simplified it to the following code:

final BufferedImage bimg = ImageIO.read(file);

JComponent mC =new JComponent(){

publicvoid paint(Graphics c){

c.drawImage(bimg, 0, 0, null,null);

super.paint(c);

}

};

JFrame ff =new JFrame(file.getName());

ff.add(mC);

ff.setVisible(true);

ff.pack();

ff.setSize(800, 600);

ff.validate();

Which as I understand means that the corruption happens at read time.

#Image formats:gif,jpeg

#Result:

Some read ok

Some read half ok/half corrupted (top screen ok/bottom corrupted)

Some read with overlaying corruption (ie. the image layers are out of place)

#JVM

1.4.2

Java 6 (latest as of 8/6/2007)

#IDE

RAD (IBM Eclipse)

Thank you

[1258 byte] By [jid1a] at [2007-11-27 6:49:15]
# 1
Consider this closed for now. Big portion of my data was corrupted on load time.Cheers
jid1a at 2007-7-12 18:22:53 > top of Java-index,Security,Cryptography...