Home / Blog / Cognifty 17: Identicons and DB Backups

Cognifty 17: Identicons and DB Backups

see your data

Released last week, Cognifty 17 brings a new identicon library as well as a simple way to backup your database.

Identicons are a nice way to visually identify something. Most of the time, people confine their use to blog posters who don't have a specific avatar image. Assuming that the poster's IP or e-mail address are unique, the identicon is a visual representation of that piece of data.

I wanted to do something a bit more useful for a site manager than simply identifying anonymous commenters on a blog. So I've added identicons to each piece of content in the admin system: specifically each piece of content which is not an image. Instead of a an icon which simply represents the mime type of the data, each page, download, article, or blog post has a unique image displayed next to it. The idea is that an editor can become more familiar with frequently linked content and identify the correct document much more easily when looking at hundreds of pages.

The identicon is based off of the content's GUID, so it will never change throughout the lifetime of the content.

The library supports two different painters, one for GD and one for SVG. The default "Geometry" based identicon can be extended for other graphic displays, such as words, fractals, or cartoons.

The standard way to create an icon is pretty simple:

 $seed = md5(rand());
 $size = 64; //pixels
 $blocks = 16; //complexity of the geometry
 
 $t['icon'] = new Cgn_Vis_Identicon_Geometry($seed, $size, $size, $blocks);
 $t['icon']->buildIcon();
 
 header('Content-type: image/png');
 echo $t['icon']->getIcon();



Comments on "Cognifty 17: Identicons and DB Backups"

 

Add a comment