Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

If the image I'm serving has the proper HTTP Content-Type is it also required that I have the image filename extension (JPG/PNG/GIF)?

Or can I just include the image in the page without?

share|improve this question
1  
    
I'd keep the image file extensions, it'll help Google and others understand what the file is, especially for image search. –  Anagio Aug 22 '12 at 22:41
1  
Is there any reason to believe Google is too stupid to understand mime types? –  Evan Carroll Aug 23 '12 at 3:33
    
youtube.com/watch?v=dSG6C33GwsE –  Anagio Aug 23 '12 at 5:34

1 Answer 1

If you're providing the correct MIME or content types, then it shouldn't make any difference. I think aesthetically though, it's better to have extensions so that if a user wishes to download an image, their computer won't have any issues opening it, and the user would know off the bat what kind of image it is. (Sometimes you'd get a "image corrupt" error.)

For older browsers, this may pose a problem if they are for some reason unable to understand the content types, or if a piece of software (PHP and cURL, "Mike's Marvelous Image Downloader", etc.) does an HTTP request to it, it may not have the same logic that browsers do.

Conclusion: stick with extensions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.