Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-01-2013, 09:52 PM   PM User | #1
britannic
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
britannic is an unknown quantity at this point
Do you need a file extension for an image/photo to work on a website

Hi:

Disclaimer: I am brand new to the forum and I do not write code. However, I do have a question regarding coding: Does a photo coded into a website need an extension, such a .jpg, gif. etc. in order to display and work properly on a website? Or can a photo's file name be titled SUNSET, not have an extension, and will display and work properly? Is it possible to accidentally drag a photo from a website to your desktop that does not have a file extension as part of the file name? While I am writing in the HTML and CSS forum my question applies to all types of website coding formats, styles, program, etc.

I would greatly appreciate any help on the subject.
britannic is offline   Reply With Quote
Old 01-01-2013, 10:45 PM   PM User | #2
tempz
Regular Coder

 
Join Date: Jul 2012
Location: London
Posts: 436
Thanks: 4
Thanked 80 Times in 80 Posts
tempz is an unknown quantity at this point
Yes.

It will need to be a "png, gif, jpg" but JPEG are used for large pixel pictures. "background etc"
tempz is offline   Reply With Quote
Old 01-01-2013, 10:52 PM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,700
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by tempz View Post
Yes.
I’m not so sure about that. I think you can display an image in a browser even without a file extension, as long as the MIME type is correct.

But anyway, britannic: Why don’t you just try it? Save an image without extension and load it in different browsers and you know it.
__________________
Don’t click this link!
VIPStephan is online now   Reply With Quote
Old 01-01-2013, 11:29 PM   PM User | #4
tempz
Regular Coder

 
Join Date: Jul 2012
Location: London
Posts: 436
Thanks: 4
Thanked 80 Times in 80 Posts
tempz is an unknown quantity at this point
Quote:
Originally Posted by VIPStephan View Post
I’m not so sure about that. I think you can display an image in a browser even without a file extension, as long as the MIME type is correct.

But anyway, britannic: Why don’t you just try it? Save an image without extension and load it in different browsers and you know it.
Oh yes, I forgot that.

Quote:
Originally Posted by http://stackoverflow.com/a/5110460
The file extension isn't used for anything, really. The browser is checking for the Content-type header, which should be something like image/jpeg or whatever type of image you're serving.

This is used pretty often in sites which dynamically serve images, often from a database. I've seen plenty of image URLs like image.aspx?id=37 which, while it technically has an "extension" doesn't really mean that it's an image. It's all in the HTTP header values.
tempz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:20 PM.


Advertisement
Log in to turn off these ads.