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 MIME type to PsdImagePlugin #4788

Merged
merged 2 commits into from
Jul 17, 2020
Merged

Conversation

samamorgan
Copy link
Contributor

Fixes #4787

Changes proposed in this pull request:

  • Register "image/vnd.adobe.photoshop" as PsdImageFile MIME type

@hugovk
Copy link
Member

hugovk commented Jul 16, 2020

Please could you add tests similar to #3525?

Also, https://wordpress.stackexchange.com/a/212334 and https://www.whatisfileextension.com/psd/ suggest there's more in use:

image/vnd.adobe.photoshop

application/x-photoshop

application/photoshop

application/psd

image/psd

Should these be added too?

@samamorgan
Copy link
Contributor Author

@radarhere Thanks for the quick check-in!

I'm not sure a mechanism exists for multiple mimetypes in this library? I'll look for examples of this in existing code and emulate that if possible. That being said, if there isn't a mechanism for this, I'd prefer we use "image/vnd.adobe.photoshop" as it's the registered IANA type (noted in issue #4787).

I'll work on tests!

@samamorgan
Copy link
Contributor Author

Looking at all of the image plugins, I only see one mimetype registered for each, so without major restructures around how mimetypes work in this library, I think we'll have to choose one and go with it.

@radarhere
Copy link
Member

Just for the record, while there isn't a mechanism for multiple simultaneous mimetypes, there is a way to customise a mimetype based on the image if there is a more specific mimetype that can be used. However, that doesn't look to be the case here - it would appear that there is no distinction between the various Photoshop mimetypes.

@hugovk hugovk merged commit 0b7077a into python-pillow:master Jul 17, 2020
@hugovk
Copy link
Member

hugovk commented Jul 17, 2020

(The s390x failure on Travis is an intermittent Travis problem.)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PSD Plugin does not register a MIME type
3 participants