MyBB Community Forums

Full Version: GIF WORKAROUND - BUTTONS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I had a feeling this might work, but wasn't sure until I tried.

I didn't want to use gifs in my new buttons because drop shadows and edges get all funky. PNG's offer the best viewing for something like that. Especially when you need the same image to show up on multiple background colors.

So ... after saving the final product as a PNG, I simply changed the extension from .png to .gif . Of course the computer told me that my file may not work are you sure you want to change the extension, etc.

I uploaded the mock gif's to the server to find that they do indeed work. Now because they are actually PNG's, if you right click and save as it has a double extension. nameofimage.gif.png - BUT the web browser still sees the image by the uploaded single extension .gif .

However - as the actual file is a .png, it displays with those properties. Perfect shadowing and no pixelation due to 256 colors in a true .gif image.

Kinda cool eh?

Check out the buttons here:

OfficialBionicWoman.com

Here's an example:

[Image: postbit_find.gif]
Well, it doesn't show a grey background on MY IE - it does on the kids computer upstairs.

Hmmmmmmmmm

S
And the light dawns - its the difference between IE 6 and 7 and how they handle PNG's

S
Oh, is that what it is? I have noticed on my computer the grey background in .pngs. So that won't happen with anyone with IE7? Good to know.

but thanks for the info. I'll give your idea a try.
To my knowledge, but I only have the two computers to compare on, and I do know that the grey background has been an IE issue for years - maybe 7 cleaned that issue up.

There is a great workaround for this issue for older versions of IE

http://homepage.ntlworld.com/bobosola/pnghowto.htm

Question is where in the heavens do you add the code and drop the java file?

Hmmmmmmmm

S
Hmm...I was just about to ask why you don't have any posts. LOL...why did you post this in testing & trashing? It will get deleted in awhile and no one can use this information.
Sorry, didnt know thats what happened in this area

LOL

S
Moved it out to Chit Chat Smile
IE6 doesn't support transparent PNGs. Great isn't it?

And yes, browsers typically don't look at the file extension, but more at the MIME type and actual contents of the file.
Chances are, if you named it to .gif though, Apache will send a MIME type of image/gif - but most browsers are smart enough to notice the PNG header, so will render it as a PNG.

I actually did this for my only theme, because I didn't want to do any template edits Toungue
Cool! Thanks for posting this! Smile
So it has the quality of a .png with the size of .gif?
Pages: 1 2