Skip to content
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

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Add ppm file to extensions #352

merged 1 commit into from
Dec 15, 2022

Conversation

andrewring
Copy link
Contributor

PPM is portable pixmap format

@@ -163,6 +163,7 @@
'png': {'binary', 'image', 'png'},
'po': {'text', 'pofile'},
'pp': {'text', 'puppet'},
'ppm': {'binary', 'image', 'ppm'},
Copy link
Member

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/

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXTENSIONS_NEED_BINARY_CHECK = {
it is then

Copy link
Contributor Author

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
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit e834194 into pre-commit:main Dec 15, 2022
@andrewring andrewring deleted the patch-1 branch August 21, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants