0

I need to extract mimetype with magic number from iWork suite.

How do? Exiftool see ".pages" etc. as "application/zip". But the real mimetype isn't this. How can i extract the correct mime?

I can use an validation with python tool if needed.

"Apline for docker".

Thanks for help.

znndrd
  • 79
  • 1
  • 8
  • There doesn't seem to be a registered MIME type for these files: https://stackoverflow.com/questions/1454777/apple-iwork-mime-types So what output would you expect? – Thomas Apr 13 '18 at 09:53
  • What mimetype do you want to be returned? It looks like it would be pretty easy to edit the [.exiftool_config](http://owl.phy.queensu.ca/~phil/exiftool/config.html) to return what you want. Or would each ".pages" file have a different mimetype depending upon the contents? – StarGeek Apr 13 '18 at 14:34
  • The mimetype of iwork files for Apple are: keynote: application/x-iwork-keynote-sffkey pages: application/x-iwork-pages-sffpages numbers: application/x-iwork-numbers-sffnumbers. I've an file without extension and forn exctract it PDF i need to take the mime from magic number. – znndrd Apr 16 '18 at 06:31
  • @Ed From what I can find out, a `.pages` file is just a zip file, similar to a `.docx` file. There is no magic number to differentiate it from a zip file. It's probably not possible to identify one that doesn't have an extension by editing the config file. Since exiftool is able to identify a `.docx` that doesn't have an extension, it might be possible for the author of exiftool to add that ability. You might want to ask on the [exiftool forum](http://u88.n24.queensu.ca/exiftool/forum) and provide an example `.pages` file that exiftool can't identify as such. – StarGeek Apr 17 '18 at 15:42
  • @StarGeek thaks for your help! – znndrd May 08 '18 at 07:20

1 Answers1

0

Phil Harvey has "Improved identification of Apple iWork files" in exiftool version 10.96. Check to see if that works for you.

StarGeek
  • 4,948
  • 2
  • 19
  • 30