Jump to content

Image hosting still changes file type data


thebruce0

Recommended Posts

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.

  • Helpful 1
Link to comment
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.

  • Helpful 1
Link to comment
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... :lostsignal:

  • Helpful 1
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...