Monday, June 15, 2009

Screenshots and DAlbum

In one of my recent tasks I explored a couple of tools available to publish screen shots (Web Based).

The aim was to get the screen shots when Hudson (CI tool) is running a build and to publish them using some web based gallery creator, for later reference of the developer or QA team.

Well the task was not tough but was a bit tricky, as the screen shot took by Xvnc plugin of Hudson was not sufficient (it took the screen shot at the end of the build, mostly an empty screen), so we decided to get a command line tool to get screen shots. And in the hunt for a command line tool we got ImageMagic and discovered that Xvnc plugin was also using the same tool.
Now by running a FOR loop in the background (when required) gave us a directory full of relevant screen shots.

Now the job remaining was to publish them, for that lot of tools are available in opensource world, basically most of them are either python or php based, but we wanted some thing which required less/no installation (extra) and could run on Apache, so we choose DAlbum (php based). Selecting this tool was not enough as it required placing the images in to it's root directory and clicking or executing Reindex.php script. Here also we made some changes as doing it with the above mentioned script increased disk usage, it created 3 copies of each screen shot (1 for thumbnail, 2nd for full screen view and the 3rd for downloading).

We overcome this issue by creating our own script which did the same job but now the size of all the three images were defined by us, the script (bash) converted the screen shot in to three different sized imaged (using ImageMagic) and then placed them into the respective directory required by DAlbum.

Here is sample command we used to get the screen shots
import -window root -display $display $screenshotpath/screenshot$i.jpg

DAlbum looks like this

For more information on ImageMagic click here.
For more information on DAlbum click here.

No comments:

Post a Comment