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 inference when uploaded images are missing mime type #13

Open
ajbozarth opened this issue Aug 16, 2018 · 3 comments
Open
Labels
bug Something isn't working

Comments

@ajbozarth
Copy link
Member

#9 added error checking for file type, but did so using mime type. This means that uploads with missing mime type (mime type = None) will fail even if the image is valid. This was discovered and addressed by the web app in IBM/MAX-Image-Caption-Generator-Web-App#39

As per discussion in #9 we should look into adding the mime type fix in the model as well. This can either be done using the same method as the web app or by using the more robust python magic library.

@ajbozarth ajbozarth added the bug Something isn't working label Aug 16, 2018
@gdequeiroz
Copy link

@ajbozarth should this be closed via #9?

@ajbozarth
Copy link
Member Author

No this is a follow up to #9 but as referenced there we can close this as "will not fix" if we would rather not spend the dev time. This is a minor edge case that can be worked around client side when encountered (like we did in the web app).

@xuhdev
Copy link
Contributor

xuhdev commented Sep 10, 2019

Yes, I agree. A properly written web application should send the correct mimetype instead of compromising the stability of this model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants