Solved

Calling a gif a jpg

Posted on 2006-11-09
3
417 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Problem I downloaded the Microsoft Internet Explorer 9 Beta, today, to give it a test drive and maybe write a review for the site, and it failed miserably and got stuck in a crash restart loop. The error message given is as illustrated below i…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

839 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