This came out of code review in the ImageStorage class:
byte[] header = new byte[getMaxSignatureLength()];
try {
ImageTools.readFully(stream, header);
} catch (EOFException ignored) {
return null;
}
This code will take the largest possible signature length for known registered types (ie. JPG, GIF, BMP, PNG) and load those bytes. But if one of these formats could store a tiny image that would be smaller than the largest signature, then that image can't be loaded as this code would throw EOF and not return a suitable loader...
byte[] header = new byte[getMaxSignatureLength()];
try {
ImageTools.readFully(stream, header);
} catch (EOFException ignored) {
return null;
}
This code will take the largest possible signature length for known registered types (ie. JPG, GIF, BMP, PNG) and load those bytes. But if one of these formats could store a tiny image that would be smaller than the largest signature, then that image can't be loaded as this code would throw EOF and not return a suitable loader...