Monday, April 30th 2007

White noise jpg fading problem in Internet Explorer 6
posted @ 5:23 am in [ Javascript -Prototype Library -Technology -Web Design -Web2.0 ]

You wouldn’t believe it was true, but there is an incredibly annoying problem in Internet Explorer 6 (IE6) where fading out jpg images using nice libraries like or prototype.js gives a strange ‘white noise’ effect on the image during the transition.

Well, it turns out it is actually a bug in IE6 where it takes true-black colours in JPG images to be transparent, and thus shows the background colour behind it when fading the image (in our case white).

So how to work around it?

Easy – go into Photoshop and adjust the levels to remove the true black in the image – Image -> Adjustments -> Levels and slide the true black slider 1 or 2 pixels to the right. Save out your image again and the jpg artifacts are gone.

Weird but true! and here’s the pointer I found to solve the problem from a Slimbox forum

– SNIP –

“white noise”: After making some tests with images showing the problem, I’ve come to the conclusion that:

– It is NOT related to the software generating the images.
– It shows in totally black areas of a jpeg image in Internet Explorer only.

It’s like the black portions of the images are interpreted as transparent by IE, so the background color (white by default) shows through them. So far I’ve only seen this happening in Internet Explorer (both IE6 and IE7). Thank you Microsoft for making the lives of web designers and programmers so fun.

Tuesday, April 10th 2007

Running osCommerce on PHP 5.2.1
posted @ 8:03 am in [ Apache -osCommerce -PHP -Technology ]

We use a lot of osCommerce in our client projects as it is one of the most advanced Open Source e-commerce systems available on the market today, and best of all we can share the code with our clients without them having to pay costly licensing contracts or even worse, cough cough, being tied in to a 3 year monthly fee contract like some other vend(or/a)s do in our market.

So, with a recent upgrade to PHP 5.2.1 on one of our development servers, osCommerce ms2.2, the best core release of the platform, refused to play ball having largely been tested and developed for PHP 4. Not to fear though, with a bit of research and a few tweaks we were able to get it up running.

1. Running your PHP as a Module rather than a CGI on Windows

In order to allow PHP local variables to be set, rather than just global ones, you have to run your PHP within Apache as a Module and for mySQL to work download and install the extra libmysql.dll from the mySQL homepages.

As we are now running PHP as a Module, rather than a CGI, it no longer automatically includes the working directory the executable is in (normally c:\program files\php-5.2.1\ or similar) so simply placing this file in that directory, as we used to do, works. You need to either add this directory to the PATH environment in Windows, or copy the libmysql.dll to the Windows/System32/ directory or similar.

Then modify your httpd.conf to include the following

PHPIniDir “C:\\Program Files\\php-5.2.1\\”
LoadModule php5_module “C:\\Program Files\\php-5.2.1\\php5apache2_2.dll”

For the php.ini uncomment the mySQL module needed (remember you need to download the extra Module DLLS for PHP 5.2.1 for this to work and path the Module directory correctly)



; Directory in which the loadable extensions (modules) reside.
extension_dir =”C:\Program Files\php-5.2.1\ext”

2. Modifying the local environment variables for PHP

In your working directory, create a new .htaccess file and assign the following PHP parameters within it

php_value register_globals on
php_value register_long_arrays on

3. Restart everything

Restart Apache to pick up the new PHP configuration, and then run a quick phpinfo(); in a test PHP file to check that the local values for the two variables above are set.

And.. you should have a running osCommerce MS2.2 on PHP 5.2.1 and Apache 2