+thebruce0 Posted October 4, 2022 Posted October 4, 2022 I know I've mentioned this before, but I thought it bore raising again: In many cases the image content type (the data and headers) are different than the filename extension. It's a minor inconsistency, but it's incorrect. I downloaded a puzzle image from a cache which was uploaded and proxy hosted, and it's being provided with the PNG extension. Passed it through a PNG parser and of course it did not work - because it's not a PNG. Its headers are for a standard JPG image. Now whether it was uploaded as a JPG and the filename was changed to a PNG, or it was uploaded as a PNG and convert to a JPG while still being served as a PNG by extension, I haven't asked. The point is - the file extension is .PNG, and it IS in fact a .JPG. This is bad design, and it's been this way, iirc, since the proxy servers were enabled, I think. The only browsers/apps that will internally "fix" this are the ones that ignore file extension and override by reading the binary data headers. Nonetheless, saving the image gives the user the wrong file type by name extension. 1 Quote
+niraD Posted October 4, 2022 Posted October 4, 2022 27 minutes ago, thebruce0 said: The only browsers/apps that will internally "fix" this are the ones that ignore file extension and override by reading the binary data headers. Unfortunately, there are too many sites like this, and browsers have been forced to accommodate such broken web sites. And this is only one example of the way the geocaching.com site breaks the way the web is supposed to work. 1 Quote
+thebruce0 Posted October 6, 2022 Author Posted October 6, 2022 On 10/4/2022 at 10:27 AM, niraD said: Unfortunately, there are too many sites like this, and browsers have been forced to accommodate such broken web sites. And this is only one example of the way the geocaching.com site breaks the way the web is supposed to work. I acknowledge that... Nonetheless, realizing now I didn't actually ask anything in the OP, the point was hopefully to give a nudge so that whoever is in charge of this image hosting 'feature' can take a look at the naming convention of the files provided and fix the .PNG extension for actual .JPG image data, or even better ensure that whatever data type is uploaded is the same data type and file extension provided by the hosting. At the very least it's just a matter of a file extension in the URL matching the content type. I can't imagine a sufficiently complex back end that would make fixing that next to impossible... 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.