Solved

Calling a gif a jpg

Posted on 2006-11-09
3
420 Views
Last Modified: 2006-11-18
Hello,

I have a website that uses this image on about 30 page: "logo.jpg".

The image is a JPG but it needs a transparency, so I really need to replace it with a GIF image.

Can I rename a file called "logo.gif" to "logo.jpg" even though it is NOT a jpeg image?   If I do that will all or at least most browsers display it correctly? Or does a gif image have to have .gif for the extension?

I am too lazy to change the HTML code in 30 pages to gif instead of jpg.

Thanks.

0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 97

Assisted Solution

by:war1
war1 earned 100 total points
ID: 17908517
Greetings, hankknight !

You cannot rename a GIF file and view it as JPG.  You need to convert the file.  If you do not have a graphic editor, use Irfanview to convert logo.gif to logo.jpg
http://www.irfanview.com/

Best wishes!
0
 
LVL 38

Assisted Solution

by:lherrou
lherrou earned 200 total points
ID: 17908708
Hankknight,

Image files have, in their header, information about what type of image they are. For that reason, some browsers will still be able to display an image even if the file name indicates it's the wrong type. For example, Firefox will display a .gif image which is called xyz.jpg or a .jpg image called xyz.gif. However, Internet Explorer, as a rule, will not. Since still the vast majority of web surfers use MSIE, if you swap the images as you suggest, a large portion of your site visitors will get the broken image symbol in their Explorer window, and not the image you want them to see.

Cheers,
LHerrou
0
 
LVL 16

Accepted Solution

by:
HackneyCab earned 200 total points
ID: 17911081
hankknight, no offence, but that is a shockingly lazy statement. I've hand-edited minor changes in 30 pages so many times that I reckon I do it in my sleep.

However, I frequently embody the spirit of the lazy, so I'll tell you the smart way to do it.

Download PSPad from http://www.pspad.com/ and use its search / replace across multiple files feature. Just make sure you understand how the search and replace works, and select the correct character encoding (which I think PSPad refers to as the codepage). Being able to replace a block of text in an entire directory structure is pretty great if you've done it by hand a dozen times before.

Oh, and just to answer your question literally: yes, you can serve a GIF with a .jpg extension, but you'll have to configure your webserver to send that file with a Content-type header that says "image/gif" rather than "image/jpeg", and that may take more time and mental effort than just editing 30+ HTML pages.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It's here again; Microsoft is launching a new version of Internet Explorer: Internet Explorer 9, with noticeable changes on its interface, functions and new tools. As they say on its promotional video: "It's time to play, on a more beautiful web", f…
Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question