OT: What do you use for ie6 pngfixes?

What do you guys use for fixing the ie6 issue with png files? I have
never been able to get any of them to work.

Here are a couple that I have tried and failed with:

Thanks for the help.

Why can’t the people capable of writing viruses focus on destroying all
the computers out there running ie6? :slight_smile:

Hi Chris,

On Tue, Apr 15, 2008 at 12:27 AM, Chris O.
[email protected] wrote:

What do you guys use for fixing the ie6 issue with png files? I have
never been able to get any of them to work.

Here’s the one I use in production, which requires Prototype:
http://pastie.caboo.se/180927

Why can’t the people capable of writing viruses focus on destroying all
the computers out there running ie6? :slight_smile:

Don’t they? :wink:

~ j.

Obviously I am doing something wrong, because that script along with all
the rest do nothing. All the famfamfam icons along with a couple of
custom png files all show the gray. I have put in some annoying alerts
to see if the scripts are being called, which they are.

Most of the scripts require a blank.gif file, which I have in the
/images folder.

All the demos on the sites that I download from work great, so it’s not
my browser.

Thanks for the help

Why can’t the people capable of writing viruses focus on destroying all
the computers out there running ie6? :slight_smile:

Don’t they? :wink:

Not well enough, I want those computer to burn :slight_smile:

http://developer.assaydepot.com/?p=17

How about that?

Actually this is one I have used before with success:

http://wheremydogs.at/index_files/the-rails-way-painless-png-in-ruby-on-rails.html

:slight_smile: The reason was that rails appends the ?XXXX to images to allow the
caching of the files to be controlled. The jQuery filter was looking to
png files that ended with the .png extension, which then never found any
of the images on the page.

Thanks for the help everyone.

The first link you posted works great for me

http://www.twinhelix.com/css/iepngfix/

There are several things you need to do:

  • open up the htc file, and change the (transparency) image path to
    an absolute path that points to where you have put your file
  • create css rules that apply the htc file to images

My stylesheet is called style_ie_6.css, and contains:

.pngfix, .pngfix img
{behavior: url(/ie_png_fix/iepngfix.htc);}

This will apply the png fix to anything with a class of pngfix
(including things with background images). I include my stylesheet in
my rails project like so (in the head of the master layout):

this is a great way to include css rules that apply only to IE6,
because it’s not a hack, and all other browsers see it as a comment.

let me know if this helps, but it has worked great for me, so it does
work with rails!

On Apr 15, 8:53 pm, Chris O. [email protected]

Jonathan F. wrote:

let me know if this helps, but it has worked great for me, so it does
work with rails!

Since I am still unable to get bg images to work I figured I would try
the helix one again. After I was still unable to get it to work I
checked out the javascript code and found the same issue with it as I
did with the last.

if (tagName == ‘IMG’)
{
if ((/.png$/i).test(src))
{
if (currentStyle.width == ‘auto’ && currentStyle.height == ‘auto’)
style.width = offsetWidth + ‘px’;
filt(src, ‘scale’);
src = blankImg;
}
else if (src.indexOf(blankImg) < 0) filt();
}

The line
if ((/.png$/i).test(src))
once again contains the reg expression that requires the src file to end
with the png extension. After making the fix, like the other lib that I
got working, still doesn’t fix bg images, which was seen after placing
an alert just after:
46: else if (bgImg && bgImg != ‘none’)

The jQuery lib that I got working was noticeably faster so I will stick
with that one.

Thanks again for the help

I remember seeing this problem at some point, I think it was fixed
though. The regexp in my copy looks completely different:

if ((/.png([^.]+|$)/i).test(src))

there is also another regular expression in there for background images:

var bgPNG = bgSrc.match(/^url[("’]+(..png[^)"’])[)"’]+[^)]*$/i);

I think I am using the preview release (which has worked without any
problems).

I understand what you’re going through right now! I tried a bunch of
different png fixes and after getting each working i found weaknesses
with most. E.g. not working with background images or having to add
sizes/dimensions to the pngs. Although, I didn’t try the jquery one,
because I didn’t want to have to make prototype and jquery play nice
together. So it might be great!

On Wed, Apr 16, 2008 at 11:17 AM, Chris O.
[email protected] wrote:

if (tagName == ‘IMG’)

with that one.

Thanks again for the help

Posted via http://www.ruby-forum.com/.


Jonathan

Hey Jonathan,

I gave the beta version a go and it works nicely :slight_smile: Thanks for posting
even after I seemed to have settled on one of the other options. That
is a huge weight off my shoulders.

Thanks again.

I can get things working in a bare bones example using ifixpng, but in a
rails project it no longer works. I am not sure if the paths used in
the javascript code are incorrect when running on a server or …?

@Nathan
Unfortunately, that one only seems to work on the image_tag method. I
have a number of background images that need fixing. Thanks though.

Nathan E. wrote:

Actually this is one I have used before with success:

http://wheremydogs.at/index_files/the-rails-way-painless-png-in-ruby-on-rails.html

no problem :slight_smile:

On Wed, Apr 16, 2008 at 12:55 PM, Chris O.
[email protected] wrote:

Posted via http://www.ruby-forum.com/.


Jonathan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs