zhanghai / MaterialFiles

Material Design file manager for Android
https://play.google.com/store/apps/details?id=me.zhanghai.android.files
GNU General Public License v3.0
6.07k stars 410 forks source link

Use file header instead of file extension for file type recognition #960

Open UnlimitedCookies opened 1 year ago

UnlimitedCookies commented 1 year ago

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.

zhanghai commented 1 year ago

Yes that's desirable, but might be a bit too slow on phones.