Solved

Calling a gif a jpg

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

SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

Question has a verified solution.

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

I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
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…
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.
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.

734 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