Lovely image rescaler thingy

Look at the lovely scaling!

So Ethan wrote a script that'll make IE6 and 7 on Windows resize images beautifully (without the performance hit you take from using -ms-interpolation-mode: bicubic;). Then Tom H pointed out that it broke the right-click and save functionality. This was acceptable to Ethan, but it bugged me.

I had an idea about how to fix it. I then set about tearing Ethan's original apart, but he's written it in proper Javascript and I'm a mere jQuery monkey. So I rewrote it in jQuery and added the bits I wanted.

Basically, it:

  1. Clones the original image
  2. Positions the clone over the top of the original, then sets it's opacity to 0. That way, you can right-click and save it (etc) but see though it.
  3. Then it does the fancy rescaler stuff to the original image.
  4. On resize it re-does the fancy stuff.

Look at this page in IE6 or 7 to see it in action. View source to see how it works. Javascript isn't my strongest suit so it's bound to have issues — feel free to rip it apart and make it super-awesome!

Olly Hodgson, May 2009.