-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ppm file to extensions #352
Conversation
identify/extensions.py
Outdated
@@ -163,6 +163,7 @@ | |||
'png': {'binary', 'image', 'png'}, | |||
'po': {'text', 'pofile'}, | |||
'pp': {'text', 'puppet'}, | |||
'ppm': {'binary', 'image', 'ppm'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point of ppm is it's not binary https://anthonysottile.com/ppm/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I look more, it's actually conditional. The magic number at the beginning of the file indicates if it should be parsed as ASCII or binary, so I guess we can't really make this kind of assertion based on extension alone, unfortunately. Is there somewhere in the existing flow that this type of check would be supported? The linux file
utility, for example, can correctly identify a binary example, like this:
frame-40.ppm: Netpbm image data, size = 1920 x 1080, rawbits, pixmap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
identify/identify/extensions.py
Line 268 in eb54678
EXTENSIONS_NEED_BINARY_CHECK = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Please let me know if there's somewhere else that also needs updating.
PPM is portable pixmap format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PPM is portable pixmap format