What if I rename an image with a custom file extension, will the choke up any browsers?
For example..
image.jpg
rename to:
image.xyz
Then in markup do..
<img src="image.xyz">
The image is still a JPEG format but simply uses a custom file extension. My tests all pass. Will this cause any potential issues?
Yes, this is possible, but you'd need to set up a MIME type in your server. Browsers don't really care about the extension, but they do care about the MIME type that the server specifies that the image should be.
When a MIME type is set, it returns this in the Content-Type
header of the response to the image request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With