TinyPortal

General => Chit chat => Topic started by: examino on November 10, 2006, 04:04:41 AM

Title: IE and PNG
Post by: examino on November 10, 2006, 04:04:41 AM
IE, not supporting PNG transparency is a huge problem afterall.  :D I found this: http://homepage.ntlworld.com/bobosola/pnghowto.htm
It's a script that might be used to solve the problem.

I can't get it to work though. I don't seem to understand where exactly to paste the code...  ::)
If anyone might know...

A proud user of Firefox, people!  ;)
Title: Re: IE and PNG
Post by: eldacar on November 10, 2006, 04:19:53 AM
Because IE 7 now supports transparent PNGs, I'd just use a conditional comment to give IE<7 a GIF instead of a PNG.
Title: Re: IE and PNG
Post by: knat on November 10, 2006, 06:32:23 AM
Thanks alot for this script... now my CP looks great for all users.

I put the pngfix.js file in my root

Then i create a center script box and put the script in there... make it use no title and no frame so it will be invisible..

And Voila.. it works..

So thanks alot  ;)

Edit:
Q: Why use png and not GIF ?

A: GIFs only allow one colour for background transparency, so a GIF placed over the intersection of another colour looks ghastly. PNG's are Truely transparent and can be placed over any backgroundcolour and still look good.
Title: Re: IE and PNG
Post by: Assistance on November 10, 2006, 07:29:15 AM
QuoteA:  GIFs only allow one colour for background transparency

my adobe photoshop would disagree with you
Title: Re: IE and PNG
Post by: knat on November 10, 2006, 07:43:50 AM
Quote from: Assistance on November 10, 2006, 07:29:15 AM
QuoteA:  GIFs only allow one colour for background transparency

my adobe photoshop would disagree with you

I found that text on the site that has the png fix :D
Title: Re: IE and PNG
Post by: eldacar on November 10, 2006, 02:41:07 PM
You can set multiple colours to transparent in a GIF, but doing so only reduces the number of useable colours in your palette. It's a waste to have any more than one transparent colour in a GIF.
More accurate to say is that PNG allows a full alpha channel of transparency, but GIF has only on/off transparency.
Title: Re: IE and PNG
Post by: examino on November 10, 2006, 04:43:31 PM
Anyway, i still can't see the solution. I have a .png logo used in Dilber. Works fine with Firefox and Opera. Internet Explorer though...well, you know. Anybody figured out where to add the script code to make it work?
Title: Re: IE and PNG
Post by: IchBin on November 10, 2006, 04:48:20 PM
Did you try what knat suggested?
Title: Re: IE and PNG
Post by: examino on November 10, 2006, 05:26:49 PM
Actually, it worked that way! Great. ;)
Title: Re: IE and PNG
Post by: aglioeolio on November 11, 2006, 12:56:45 PM
great tip, thanks albadon

alpha transp. in that green car (rigth side of this page (http://homepage.ntlworld.com/bobosola/pngtestfixed.htm)) is perfect in IE6.0 (I dont use it, but 90% of my board users do)
Title: Re: IE and PNG
Post by: bloc on November 11, 2006, 01:35:20 PM
With some carefully selected background color, the gif can work good still...at least if you plan on using just one theme.
Title: Re: IE and PNG
Post by: misfitmafia on November 11, 2006, 09:06:20 PM
I use this same script on my page, here is how to get it to work with TP.

Place this code in the <head> section of your index.template.php file

<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

The download the pngfix.js file and place it in the folder you installed smf in. For example my folder name is smf, another common folder used is forum, just make sure its the root folder for your forum.

Title: Re: IE and PNG
Post by: examino on November 14, 2006, 12:00:42 AM
Yes, that's what i did also misfitmafia. I was coming to make a post about it...  ;)

Knat's suggestion works fine as well if anyone want to try it...