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

Input images with wrong content-type/extension give 500 #106

Open
jonnor opened this issue Nov 15, 2016 · 3 comments
Open

Input images with wrong content-type/extension give 500 #106

jonnor opened this issue Nov 15, 2016 · 3 comments
Labels

Comments

@jonnor
Copy link
Member

jonnor commented Nov 15, 2016

Example request
https://imgflo.herokuapp.com/graph/851b8fd15e770b1/bdc2476fe451696ebc84c2a17fbfb78d/passthrough.jpg?input=https%3A%2F%2Fimgflo.herokuapp.com%2Fgraph%2F2b2431f8e7ba7b0%2F8a82878dd7f43d6e39d117119257b395%2Fnoop.jpg%3Finput%3Dhttp%253A%252F%252Fassets.atlasobscura.com%252Farticle_images%252F36870%252Fimage.jpg&width=720

The input image is served as jpg, but is actually a PNG file
http://assets.atlasobscura.com/article_images/36870/image.jpg

      -  "Not a JPEG file: starts with 0x89 0x50"

file image.jpg
image.jpg: PNG image data, 800 x 1066, 8-bit/color RGBA, non-interlaced
@jonnor jonnor added the bug label Nov 15, 2016
@jonnor
Copy link
Member Author

jonnor commented Nov 15, 2016

Web browsers generally handle this case fine, so we should too.

This happens because we trust, and specify a particular GEGL file loader based on that. It looks like gegl:load support some file sniffing now though, in which case should be easy-fix.

Related #31 #23

@jonnor
Copy link
Member Author

jonnor commented Nov 23, 2016

Another example failing is https://imgflo.herokuapp.com/graph/851b8fd15e770b1/3d6034f3cf95fcc516d9e269f8222b73/passthrough.png?input=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fthe-grid-img%2Fp%2F4c2aa71f774183b698c1df3f3a0bac4a57df5dd9.png&width=600

The input there is 4c2aa71f774183b698c1df3f3a0bac4a57df5dd9.png: JPEG image data, Exif standard: [TIFF image data, little-endian, direntries=0], baseline, precision 8, 600x315, frames 3

@jonnor
Copy link
Member Author

jonnor commented Jan 17, 2017

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

No branches or pull requests

1 participant