Skip to content

[ON-HOLD] feat: Add some filetype guessing capabilities - #127

Closed
tmathern wants to merge 59 commits into
mainfrom
mathern/add-extension-guessing
Closed

[ON-HOLD] feat: Add some filetype guessing capabilities#127
tmathern wants to merge 59 commits into
mainfrom
mathern/add-extension-guessing

Conversation

@tmathern

@tmathern tmathern commented Jun 25, 2025

Copy link
Copy Markdown
Collaborator
  • Add some very basic filetype guessing capabilities to handle files that are extensionless but the recommendation for usage would be to use files with extensions. So there is no doubt about the filetype.

@tmathern tmathern self-assigned this Jun 25, 2025
@tmathern
tmathern requested a review from gpeacock June 25, 2025 21:55
@tmathern
tmathern changed the base branch from main to mathern/sign-file June 25, 2025 21:56
Comment thread src/c2pa/c2pa.py
Base automatically changed from mathern/sign-file to main June 26, 2025 23:10

@gpeacock gpeacock left a comment

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.

This is a great example of why I want most of the functionality tests in Rust instead of repeating them in every language. The appropriate level of testing in python should just be to validate that a file without an extension can be processed. The rest of the tests should be handled in Rust so that we don't need to duplicate them, and all the test files everywhere. Large test files slow down builds.
I'd prefer most of these test files to only live in one place. We may want to create a separate repo for them if they really need to be shared like this.

Comment thread src/c2pa/c2pa.py Outdated
@tmathern

tmathern commented Jun 27, 2025

Copy link
Copy Markdown
Collaborator Author

This is a great example of why I want most of the functionality tests in Rust instead of repeating them in every language. The appropriate level of testing in python should just be to validate that a file without an extension can be processed. The rest of the tests should be handled in Rust so that we don't need to duplicate them, and all the test files everywhere. Large test files slow down builds. I'd prefer most of these test files to only live in one place. We may want to create a separate repo for them if they really need to be shared like this.

So hmmm, how do we proceed? Do you want me to remove the test files (and related tests for the mimetype guessing, then - aka the whole TestHelpers class currently)? As I added 3 tests that cover extensionless files.
Noting that this becomes obsolete once that code has been pulled down there.

@tmathern
tmathern requested a review from gpeacock June 27, 2025 17:28
@tmathern

Copy link
Copy Markdown
Collaborator Author

Let's put a pin in that for now - if the guessing moves down soon to the c2pa-rs Rust code SDK, we can heavily simplify that (by just adding the tests to verify the functionality).

@tmathern tmathern changed the title feat: Add some filetype guessing capabilities [ON-HOLD] feat: Add some filetype guessing capabilities Jun 27, 2025
@tmathern tmathern closed this Oct 1, 2025
@tmathern
tmathern deleted the mathern/add-extension-guessing branch October 1, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants