Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support files with non-zero padding #370

Open
achaikou opened this issue May 11, 2021 · 0 comments
Open

Support files with non-zero padding #370

achaikou opened this issue May 11, 2021 · 0 comments

Comments

@achaikou
Copy link
Contributor

According to LIS79 specification,

a Physical Record may be padded with null characters to guarantee a minimum record size.

RP66 specification says nothing on the matter.

In reality we however see many files with random(?) padbyte characters added after the record to assure that for every record (declared_record_length + size(padbytes)) % 4 == 0.
At the moment we always saw it to be 2 characters. These two characters are not included in the record length.
For example

  • if record length is 0x8A, 2 bytes are added after the record.
  • if record length is 0x8C, no bytes are added after the record.

It happens in both dlis and lis files, but looks to be more common in lis ones.

At the moment we saw these %4 padded files wrapped into 2 types of envelopes:

  • TIFed files
    TM.next correctly skips 2 padding bytes (if they are present) and points to the start of the next TM
    image

  • Unknown envelope (LIS only).
    We do not have enough information to state for certain, but it looks like size of the record + size of possible padbytes is written in little endian before each record. For example:
    48 03 03 48 ... (length 03 48 is divisible by 4, so no padbytes, so wrapper records the same length)
    8C 00 00 8A ... XX XX (length 00 8A is not divisible by 4, so 2 padbytes are added, so wrapper counts that length)
    image
    There is however no confirmation to this and we also don't know how many such files exist.

Note:
It's unclear if these envelopes can be mixed or if %4-padded files can be not wrapped into anything at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant