Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Calling a gif a jpg

Posted on 2006-11-09
3
Medium Priority
?
422 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 400 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 800 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 800 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
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 +…
Suggested Courses

609 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