contentauth / c2patool

Command line tool for displaying and adding C2PA manifests
Apache License 2.0
94 stars 30 forks source link

Don't rely on file extensions #150

Open hackerfactor opened 8 months ago

hackerfactor commented 8 months ago

The current code uses file extensions to determine the type of file.

However, it is very common to have a file without an extension ("image.dat") or to have the wrong extension ("image.jpeg" that is really a GIF or PNG).

The current code cannot process the file if it has the wrong extension.

The code should really be using 'magic' to determine the file type, rather than relying on the file extension.

hackerfactor commented 3 months ago

c2patool fails to recognize .m4v, .3gp, and other common mp4/mov compatible files. Renaming the files to .mp4 or .mov allows them to be processed.

If the code used 'magic' to determine the file type, then it would handle all of these other video formats without requiring manual renaming.

gpeacock commented 2 months ago

Thanks, sorry for the slow response. I'm planning to add that functionality to the c2pa-rs code and c2patool will inherit it.