isValidFile method
Is the given file a valid BMP image?
Implementation
@override
bool isValidFile(Uint8List data) {
if (!BmpFileHeader.isValidFile(InputBuffer(data)) || data.length < 18) {
return false;
}
// Validate the DIB header size to avoid misdetecting non-BMP files that
// merely start with the 'BM' signature.
final dibHeaderSize = (InputBuffer(data)..skip(14)).readUint32();
return dibHeaderSize >= 12 && dibHeaderSize <= 124;
}