Defensio 2.0 released!

January 22, 2010
pixelpost.png

This week the guys and girls from Defensio have released the 2.0 version of their API. Not only a SPAM filter, but Defensio can now eliminate malware and other unwanted or risky content from your blog. The best part is Pixelpost supports the latest API version through a new release of the Defensio addon for Pixelpost.

A major difference is the way content is evaluated. The old version depended on an instant results after querying Defensio, sometimes resulting in comments not being processed when the service was hammered with request. Therefore the content is now evaluated asynchronous, sending the content to Defensio which will provide a callback when the processing is done.

Initially all comments for Pixelpost make it into the Defensio Quarantine. These comments can basically have two statuses: FAIL and PENDING. The later means that the results through the callback are not in yet (you can issue a query to fetch them right away). The status FAIL means that for some reason Defensio could not be contacted (either the service is down or the API key is invalid or..). In that case you can send these comments to Defensio for an evaluation.

The major drawback of the 1.0 version of the addon was that each comment that had failed had to be rechecked manually. This issue has been resolved with the addition of a new button that processes every comment with a status of FAIL or PENDING for the last two weeks. Obviously the buttons to send either HAM or SPAM to Defensio remain in full effect.

For more information about the new Defensio checkout the “What’s new with Defensio 2.0?” or the video below. You can also download the latest plugin for Pixelpost.

Comments
1 Comment »
Categories
Programming
Tags
, , ,

Bughunting

November 2, 2009
bug.gif

Since my photoblog layout is based upon a very old Mootools version I decided to redesign and reprogram the layout, switching from Moo to jQuery. The initial sliding sidebar along with some other options were quickly established and proved to be ok in Firefox, Chrome and Safari.

Enter the dreaded Internet Explorer, currently at version 8. After having the luxury to debug my JS using Firebug I have to say JS debugging on IE still pretty much sucks. Sure, it will give you errors, but these are so cryptic I couldn’t understand them if my life depended on them. Luckily we have Google at our disposal, so a quick search around the net showed several people having similar issues. So that is a good thing, it means we’re not alone in this.

But after reading several threads it just boiled down to one thing: trail and error. Shape and reshape the code until it finally starts working. It took me several hours, but now the code is working on all browsers, including IE 7 and IE 8. Looking back 1/5th of the time was used to created the page so it worked and the other 4/5th of the time was spend debugging IE specific issues (a fact well known as illustrated by the image below).

Sad but true

Comments
1 Comment »
Categories
Programming, Website

Strange behavior GoogleMap addon when using EXIF GPS coordinates

October 14, 2009
googlemaps.png

Today I managed to get to the root of a problem I have been trying to eliminate for some time now. It all has to do with the “use the EXIF coordinates” feature of the GoogleMap addon for Pixelpost. It seemed when using this feature the location magically shifted a few meters or even more.

When using reverse geocoding for latitude and longitude values Google Maps focuses on nearby (and sometimes not so near by) “points of interest” or the closest address it can find. This behavior can be changed by changing the following Javascript function function showLocationLatLng().

Change the code of that function to:
function showLocationLatLng() {
var latlng = new GLatLng(document.forms['view-latlng'].lat.value,document.forms['view-latlng'].lng.value);
editMap.addOverlay(new GMarker(latlng));
editMap.setCenter(latlng, 16);
}

This will force the addon to use the exact location of the image provided in the EXIF.

Optimization results

September 10, 2009

As mentioned yesterday I’m working on a new version of the Googlemap addon. The current version features clustered markers with an Flickr style info window. It is hard to believe I wrote that nearly 18 months ago. In internet time that is like ages ago.

Anyway, there were some bugs with that initial version, most noticeably the fact the scroller kept on scrolling while there were no images. Furthermore, the image that was supposedly the last image ended up on random places in the set. Something you’d rather not see with an image that says: “this is the last image”.

So I decided to take another approach and over the course of 18 months on the internet lots of new software was developed, far more advanced than what I have now. So I searched a bit and found an excellent example over at Woorks place. Only problem was it used Prototype as a JS framework while I really wanted to use the more lightweight kid on the block: JQuery.

I managed to rewrite the whole thing in JQuery using The JQuery Tools and decided to compare them head-to-head. So here are the charts from Yahoo! Yslow:

scroller_old scroller_new
(The one on the left is the old situation with Prototype, while the one on the right is the new JQuery solution)

As can be seen I managed to cut down the size from 257Kb to 86Kb, a size reduction of 67%. This reduction is caused by the much smaller JQuery framework in combination with the JQuery Tools compared to Prototype. I bet I can squeeze it even more down by using GZip to send the page. However, that will probably squeeze down the Prototype based page also. :p

So far it works in IE8, Chrome and Firefox, while there are some minor issues in IE7 that I need to address.

Comments
2 Comments »
Categories
Programming

Projects I’m currently working on

September 9, 2009

The site hasn’t seen much updates lately, but as usual there is a good reason for that. I’ve been busy working on several projects. Inquisitive readers might ask what those projects are. Well, let me reveal at least some of them.

One of the projects I’m working on is the Adobe Photoshop Lightroom Export Plugin,, initially developed by my buddy Jay. As not only the author but also user of both the Googlemap addon and the FTP security addon I needed to modify the Lightroom Export plugin to facilitate both GPS coordinates and the automatic opening and closing of both the image and the thumbnail folders. Currently we have a working copy which I use extensively in testing right now. Did I mention we also managed to squash some bugs while producing cleaner code?

The other project I’m working on is the aforementioned Googlemap addon. Since I began working writing code in a more OOP manner I could see how this approach could seriously limit the duplicate code currently found in the addon. I found a nice Googlemap API Class for PHP and intend to use that as a base to rewrite the addon yet again. All features of the (unpublished) third version will be retained, but it will be lean and fast thanks to the use of OOP practices.

Last but not least I’m also working on the new version of Pixelpost. Recently we added two more plugins dealing with both tags and categories. While testing and writing new things resumes we’re building the next-generation photoblog with a solid codebase.