Skip to content

Auto detect compression by magic numbers#17

Open
kayoub5 wants to merge 2 commits into
masterfrom
feature/magic_file
Open

Auto detect compression by magic numbers#17
kayoub5 wants to merge 2 commits into
masterfrom
feature/magic_file

Conversation

@kayoub5
Copy link
Copy Markdown
Member

@kayoub5 kayoub5 commented Oct 31, 2021

No description provided.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 31, 2021

Codecov Report

Merging #17 (d0af0ed) into master (68a8bef) will decrease coverage by 0.04%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
- Coverage   72.96%   72.91%   -0.05%     
==========================================
  Files          17       17              
  Lines        1080     1093      +13     
==========================================
+ Hits          788      797       +9     
- Misses        292      296       +4     
Impacted Files Coverage Δ
src/light_io.c 65.30% <76.92%> (+1.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68a8bef...d0af0ed. Read the comment docs.

@kayoub5 kayoub5 requested a review from LarsVoelker October 31, 2021 22:49
Copy link
Copy Markdown
Member

@LarsVoelker LarsVoelker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a bit of more comments for the signatures and adding the gzip signature 0x1f 0x8b.

Comment thread src/light_io.c
return NULL;
#endif
}
if ((signature & 0xff000000) == 0x78000000) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might be missing: 1F 8B for gzipped files, don't we?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x78 start is zlib.

Comment thread src/light_io.c
if (signature == 0x0a0d0d0a) {
return light_io_file_open(filename, mode);
}
if (signature == 0x28b52ffd || signature == 0x25b52ffd || signature == 0xfd2fb528) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this all Ist???

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

Successfully merging this pull request may close these issues.

3 participants