For some reason, opening up some PNG files using ImageBuffer and ImageIO does not work. Here\'s some code I am using that works fine for resizing/cropping JPGs:
When running my function on Windows, croppedImaged.getType() returns the value 5. So, the simple "hack" is to store the type, check to see if it's 0... and if it is, set the value to 5 manually.
int imageType = croppedImage.getType();
if(imageType == 0) imageType = 5;
We then pass in imageType instead and it should work on Linux.
I am sure this has the drawback that if the value is 0 in other cases, it will set it to 5 and that will be wrong. However, this seems to work for common image types on Linux and it hasn't caused any problems.
It's pretty clear that the Windows version of Java 1.6 is perfectly fine, but the Linux version has a bug in it.