Solved

Calling a gif a jpg

Posted on 2006-11-09
3
409 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now