The Trouble with PNG Images

I’ve recently been doing a web site refresh for someone who wanted their site to be more up to date looking, less ‘blocky’ and still CSS-based and standards-compliant. They’d had another designer approach them – or more particularly, the boyfriend of a staff member had approached them – and knocked up a good-looking, if table-based, version of their home page.

OK, he’d forgotten to check the site in different browsers and on different platforms, so it was very broken and likewise it was nowhere near being standards-compliant, but hey-ho…

So they asked me to produce a working, standards-compliant version which I duly did. One of the elements they wanted was a navigation bar to match their current logo colours and I created the background for the navigation area and saved it as a PNG: I didn’t want a GIF image due to the blockier look of the curved ends that would result from using that format and I didn’t want a JPG image due to the file size (I try to ensure my pages come banging in as quickly and efficiently as possible).

The result looked great in all the browsers I tested it on.

The client then asked me to change the navigation element so that there was some mouseover effect, so I went for their logo colour on the text over white when the mouse is over the link and white text over their logo colour in the ‘off’ state. At this point, it looked great in Firefox, Opera, Safari, etc. but the colours were off in Internet Explorer 7 (which has only recently included support for PNG images).

I thought it was just my CSS being screwed up and checked the PNG file I was using for the DIV background against the hex code I was using for the navigation element colour and found they were exactly right. I then did a screenshot and lifted the hex code from the background to find that it was different to the original image when displayed in Internet Explorer 7. The reason? Gamma correction within PNG images which gets stripped out by web browsers except for Internet Explorer! I’d never come across this before as I was used to using GIFs and JPEGs due to the earlier lack of PNG support in Internet Explorer.

There’s a good blog entry about it here that links to this article and this paper.

Declaring SORN

Well, I would if I could.

I realised yesterday that the tax has run out on my bike as of the end of October. Now given the bike’s been in the garage since it was last used in September, it’s hardly surprising that I’d forget.

But as it’s not been used on the road, surely that’s not an issue? Well it never used to be until the irritating idiots running this country decided on another scam called a Statutory Off-Road Notification whereby if you take your vehicle off the road you have to tell them or they come after you for the “lost” tax.

Now they’ve decided to allow you to do this online … or at least you can when it’s actually working:

“I am sorry the service is currently unavailable due to essential maintenance.”

And it’s been down all weekend for me. I wonder how much of my tax went on this useless system?

The Trouble with Blogs…

Addictive things, these blogs.

But if, like me, you’re often out and about and between computers, you too may have suddenly thought of something you would like to share with the blogosphere. And, like me, you may have been frustrated that you couldn’t, because by the time you’ve made it to somewhere with a computer and an Internet connection you’ve forgotten what it was you were going to blog about.

Now I know I can blog by e-mail (or using Shozu) using my mobile phones, but when I’m hacking along the road in my car or on my bike, the last thing I should be doing is composing an e-mail using the tiny keyboard (even if the handset is in a cradle).

No, what would make a killer app. (or plug-in) for WordPress would be a voice to text posting facility, somewhat like the Voice Post feature on LiveJournal but with instant, automated transcription.

Now that would be cool (and remember where you saw the idea first!).

The Trouble with e-mail…

I have registered hundreds of domain names over the years. And going back to the glory days before Spam was a significant problem, I’ve always been used to having “catch-all” e-mail addresses and with that in mind, using onlineresource@domainname e-mail addresses with no worries: registering at websites with theirname@mydomain e-mail addresses knowing that e-mails sent to those addresses would find their way to me.

If I started to receive Spam to one of these addresses, it was easy enough to set up that e-mail address as a null mailbox so that any Spam would get nuked.

But the Spammers then decided to start using anynumbersandletters@mydomain e-mail addresses to Spam or unscrupulous(!) list sellers would simply make them up and add them to their x million e-mail address lists. So the Spam would increase.

And then they decided to forge the From: addresses using their made up e-mail addresses so not only do you receive the Spam, but you also receive all the bounce messages too.

Which is why I came back yesterday evening to find 7400+ bounce messages waiting for me, the majority of which were sent to one old domain name. So I then had to use Google Desktop Search to find all the e-mail addresses I’d used with that domain name and do the opposite of what I’d always done: kill the catch-all setting and set up new individual addresses.

All because of some bunch of lowlife scum…

JavaScripted e-mail Links in WordPress Pages

You may want to include an e-mail link in your WordPress Blog’s “About” page or elsewhere, but no doubt you don’t want this harvested and you’ve found you can’t simply add the JavaScript to the post or page as it gets nuked.

So how about a workaround?

Firstly, you need to create an external Javascript file with this code (amended for your own needs, obviously):


function obfuscate() {
var ppclink = "Click here to e-mail us";
var ppcname = "nospamthanks";
var ppchost = "yourdomainnamegoeshere";
document.write("<a href=" + "mail" + "to:" + ppcname + "@" + ppchost + ">" + ppclink + "")
}

NB: the “@” sign is represented in the code as “& # 64 ;” with no spaces.

Save it as something like emailobfuscator.js and upload it to your server.

Then in the post or the page you want to include it in, add the following code:

<script type="text/javascript"
src="/scripts/emailobfuscator.js" mce_src="/scripts/emailobfuscator.js">
</script>
<script type="text/javascript">
<!--
obfuscate();
//-->
</script>

You will almost certainly want to uncheck the “Use visual editor when writing” checkbox in your User options before this will work.

And the finished result should look like this:

The Trouble with WordPress

Now I’m a great fan of WordPress – quelle surprise – using it for a number of blogs as well as some basic CMS based web sites.

But when it comes to posting new messages and restricting their publication, it’s a bit lacking. I have a LiveJournal and have been introduced to a number of good friends even if they are in some cases entirely virtual with no face to face or indeed voice contact … ever! And on LiveJournal I can quickly and easily restrict who can and cannot see individual posts on a per group basis.

With WordPress – at least as far as I can see – the only way to restrict access to a post is by way of password protection. Which is fine, providing the intended readers don’t forget that password, or don’t divulge it to someone else or indeed have the password guessed or hacked by A N Other.

Such a pity.

What a Difference a Day Makes

I looked at another commercial blog the other day and liked its look and feel before discovering its theme was K2 so I downloaded it, played with it and voila!

So I have temporarily (?) abandoned the rather fabby fspring theme from Fredrik Fahlstad (which I am still using as basis for a number of other blogs) and playing with this one for now.

You see, this is one of the great things about separating content from style: you can always modify the style without needing to recreate the content. WordPress and the themes people develop for it just make things easier.