You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The File_Size field in the BMP_File_Header (bytes 2-6) do not appear to be correct. This field has a value of 60514, but the file size is actually 60618 bytes, so it's short by 104 bytes. Either this is intentional and the File_Size field isn't supposed to describe the size of the entire file in some cases, or this field is corrupt--it's not obvious to me based on a quick reading of the spec. If it's the latter and this field is corrupt, I assume most bitmap parsers just ignore this field and rely entirely on fields in the DIB_Header to parse a full bitmap file, so this field being wrong doesn't really matter in most cases. Which leads to issue 2:
This schema is not really complete. All it really does is parse the BMP_FIle_Header and the DIB_Header and treats the rest of the file as a blob. In order to calculate the length of the rest of the file to turn it into a blob, we use the aformentioned File_Size field and subtract the lengths of the BMP_File_Header and DIB_Header. But this relies on a correct File_Size field which does not appear to be the case.
The right fix is probably to update the schema so that we actually describe the pixel data, or at least use different fields to figure out the length the pixel data if we can't always rely on the accuracy of the File_Size field.
The last 106 bytes of the BMP in the attached zip are removed after the file is parsed and unparsed using Daffodil 2.7.0 (Java API).
token.zip
The text was updated successfully, but these errors were encountered: