2009-12-25

Photo Gallery

Recently, I created a photo gallery with my personal photos. The gallery is fashioned only as preview for fast look-up. It contains only non-processed images. I think that it would be better than current state when I'm buffering images somewhere on disk(s). Images which waits for detailed image processing (panoramas, various image operations, etc), can be public available by this way.

The gallery is generated as a static web pages by llgal. The generation is very fast. It needs only manually download images from camera and running of some scripts. I have checked also photon which do similar job, but neither full-evening hacking didn't fit my requirements on
appearance and functionality.

All images, in the galleries, are generated from RAW Canon files by dcraw and convert (Imagemagic). As output format, I choose JPEG to importantly reduce image sizes for fast browsing. The quality is poor, but images are small.

for A in *.CR2;
do
# from RAW to 1000x666 pixel JPG
dcraw -c -f -q 3 -w -h $A | convert - -geometry 1000 ${A%CR2}jpg
# add copyright
composite -dissolve 30 -gravity SouthEast copyright.png ${A%CR2}jpg ${A%CR2}jpg
done

An important parameter for dcraw is -w which set color temperature from parameters supplied by a camera. It is important: when I have set the color temperate to a different one, my older images are toned to red. That is because of dcraw default uses 6500 (for D65 illuminant). I have set the temperature according of Sun (5700) which is bad idea because of illuminant D65 have no thermal spectral flux density.

I'm adding a signature to every image as L.Lessig recommends. The signature itself is created as a muster by the command:

convert -size 80x17 xc:none -font Courier-Bold -pointsize 14 \
-stroke black -strokewidth 5 -annotate +4+12 '© F.Jetel' \
-fill white -blur 0x4 -stroke none -annotate +4+12 '© F.Jetel' \
copyright.png

and added with composite command (above in processing loop) to images. The signature image has transparent background (xc:none), and some decoration (options -stroke and -blur). The signature is partially transparent when it added to images to suppress thickness (-dissolve).

For documentation purposes it is important include useful information about images. Unfortunately, JPEGs created by dcraw conversion has removed an important information as a time of exposure etc. So I'm adding selected exif information to JPEGs via exiftool:

exiftool -tagsfromfile "%d%f.CR2" -r -ext jpg .

From files prepared by the described way, it is possible create of a gallery by the command:

llgal -f --exif "FileName,ImageWidth,ImageHeight,CameraModelName,CreateDate,ExposureTime,ISO,FocalLength,LensType" --title "Geminidy 2009" --cf

Also, for updating of list of galleries, I'm using the command:

llgal -L -S --exclude copyright.png --title "Photo Gallery"

That's all. Please, change the name in copyright when you will copy my scripts to your galleries.

2009-12-10

Munipack vs. Mercurial

I uploaded Munipack's source version tree to Google's Mercurial repository a few minutes ago. The step has been invoked by idea to provide of a public access of current code changes via Google's version repository. Munipack's archive is accessible on Google's code:

http://code.google.com/p/munipack/source/checkout

I'd used classic CVS before two weeks ago. Unfortunately, Google doesn't offers CVS, so I explored SVN, Mercurial and Git. Therefore I explored these version systems. By my opinion, SVN isn't step forward. Features of both (CVS vs. SVN) overlaps and the turnover practically offers only different codes (aliases) for operations.

Both Mercurial and Git are acceptable and with an excellent design. The selection Mercurial vs. Git is really difficult. Finally, I selected the Mercurial only for its wider portability, which is really important for me (and also for Mercurial's simple usage and nice guide).

Beginning experiences are really amazing. The most important for me is absolute free modification of the code. It's possible to work on two or more parts of code together, so I can simply focus on an problem (feature) which I'm thinking about. The development is more free from causality now and I can do more risky actions without any fear.

The publishing of source code make a possibility to simply provide of two branches of Munipack. A stable branch created from a taged running version tree and a development branch with an experimental code.

Also, it opens door for an independent developing...