zhanghai / zhanghai/MaterialFiles
Use file header instead of file extension for file type recognition
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 9k
- Forks
- 736
- PR merge metrics
- No merged PRs in 30d
Description
On Unix systems it is common to decide on the file type based on the something called magic bytes in contrast to using solely the file extension. Nautilus for example does adhere to this convention. Would it be possible for Material files to do the same? How much would the performance cost for this change?
I noticed this bug while scrolling through cached data which didn't have any file extension or some generic .0. As soon as I renamed the file to .webp the file manager correctly showed the image preview and also suggested the right application to open with.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by locating MaterialFiles' file-type recognition path and assessing cached files without extensions; define acceptable magic-byte coverage and performance before implementing, then verify previews and application suggestions for extensionless files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100