#!/usr/bin/awk -f # # info2hepu -- make galleries from info for hepu # # usage: info2hepu forceconvert=1 galleries.info # info2hepu key=_tag < gallery.info # # http://www.heikopurnhagen.net/software/info2hepu # # This program is available under the terms of the GNU General Public # License (GPL). All usual disclaimers apply! # # Heiko Purnhagen (mail@heikopurnhagen.net) # HP 20080816 # HP 20090930 added option idxlnkanc to enable anchors in index links # HP 20100831 don't upscale small images (800x800>) BEGIN { numinfo = 0; forceconcert = 0; key = ""; idxlnkanc = 0; } { if ($1 == "DIRKEY") { hepudir[numinfo] = $2; if (key == "") { hepukey[numinfo] = $3; } else { hepukey[numinfo] = key; } getline; title[numinfo] = $0; getline; caption[numinfo] = $0; getline; srcdir[numinfo] = $0; getline; year[numinfo] = $0; getline; webdir[numinfo] = $0; getline; thumb[numinfo] = $0; numinfo++; } } END { print "INFO2HEPU numinfo=" numinfo > "/dev/stderr"; for (i=0; i "/dev/stderr"; system ("ensure-rot srcdir='" srcdir[i] "' < " listname " > " rotname); system ("makehtmlgallery7 title='" title[i] "' defcap='" title[i] "' idxcap='" caption[i] "' srcdir='" srcdir[i] "' usemap=0.5 forceconvert=" forceconvert " idxlnkanc=" idxlnkanc " destdir=" hepudir[i] " highqual=1 imgsize='\"800x800>\"' footer='Photo: Heiko Purnhagen " year[i] "' key='" hepukey[i] "' < " rotname " > " indexname); } else { print "UNCHANGED GALLERY " indexname > "/dev/stderr"; } } } #--