Don't rely on file extensions
The current code uses file extensions to determine the type of file.
- It assumes that "image.jpg" and "image.jpeg" is a JPEG.
- It assume that "image.png" is a PNG.
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.
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.
Thanks, sorry for the slow response. I'm planning to add that functionality to the c2pa-rs code and c2patool will inherit it.
It is not that simple, not all BMFF files will be supported by the tool. We prefer to test before we simply add to the list.
No matter what c2patool supports, not requiring file extensions would still be very helpful.