--- /dev/null
+# Simple Photo Gallery
+# (c) 2003--2005 Martin Mares <mj@ucw.cz>
+
+package Gallery;
+
+use strict;
+use warnings;
+
+BEGIN {
+ # Standard Perl module stuff
+ use Exporter();
+ our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+ $VERSION = 1.00;
+ @ISA = qw(Exporter);
+ @EXPORT = qw(&SetOptions &Start &img &Finish &RawHTML);
+ %EXPORT_TAGS = ();
+ @EXPORT_OK = qw(%CF);
+}
+
+our %CF;
+our $th;
+
+BEGIN {
+ $CF{"Title"} = "An Unnamed Gallery",
+ $CF{"HeadExtras"} = "",
+ $CF{"TopExtras"} = "",
+ $CF{"BotExtras"} = "",
+ $CF{"ParentURL"} = "../",
+ $CF{"BackURL"} = "",
+ $CF{"FwdURL"} = "",
+ $CF{"ImageSubpages"} = 1,
+ $CF{"AllowArchives"} = 1,
+ $CF{"PhotoUrlPrefix"} = "",
+ $CF{"ThumbUrlPrefix"} = "",
+ $CF{"MetaDataDir"} = ".",
+ $CF{"PhotoDir"} = ".",
+ $CF{"ThumbDir"} = ".",
+}
+
+sub SetOptions(@) {
+ while (my $o = shift @_) {
+ my $v = shift @_;
+ $CF{$o} = $v;
+ if ($o eq "Theme") {
+ require $CF{"GalDir"} . "/$v/theme.pm";
+ Gallery::Theme::Init($CF{"GalURL"} . "/$v");
+ }
+ }
+}
+
+sub Start() {
+ if (defined $ENV{"GATEWAY_INTERFACE"}) {
+ require Gallery::Web;
+ $th = new Gallery::Web;
+ } else {
+ if (@ARGV && $ARGV[0] eq "--generate") {
+ require Gallery::Generator;
+ $th = new Gallery::Generator;
+ } else {
+ print STDERR "Usage: $0 [--generate]\n";
+ exit 1;
+ }
+ }
+ $th->Start();
+}
+
+sub img($$) {
+ $th->img(@_);
+}
+
+sub Finish() {
+ $th->Finish();
+}
+
+sub RawHTML($) {
+ $th->RawHTML($_[0]);
+}
+
+1;
--- /dev/null
+# Simple Photo Gallery: Web Archiver
+# (c) 2005 Martin Mares <mj@ucw.cz>
+
+package Gallery::Archive;
+import Gallery qw(%CF);
+
+use IO::Handle;
+
+sub new($$) {
+ my ($cls, $type) = @_;
+ my $x = { 'type' => $type, 'files' => [] };
+ return bless $x;
+}
+
+sub Start($) {
+ my ($this) = @_;
+ my $type = $this->{'type'};
+ my $cts = { "tar" => "application/x-tar", "zip" => "application/zip" };
+ defined $cts->{$type} or die "Unknown archive type $type";
+ print "Content-Type: ", $cts->{$type}, "\n";
+ print "Content-Disposition: inline;filename=gallery.$type\n";
+ print "\n";
+}
+
+sub Finish($) {
+ my ($this) = @_;
+ my $type = $this->{'type'};
+ STDOUT->flush();
+ chdir($CF{"PhotoDir"}) or die;
+ if ($type eq "tar") {
+ system("/home/mj/bin/tar", "cf", "-", @{$this->{'files'}});
+ } elsif ($type eq "zip") {
+ system("zip", "-", @{$this->{'files'}});
+ } else { die; }
+}
+
+sub RawHTML($$) {
+}
+
+sub img($$$) {
+ my ($this, $orig, $annot) = @_;
+ push @{$this->{'files'}}, $orig;
+}
+
+1;
--- /dev/null
+# Simple Photo Gallery: Thumbnail Generator
+# (c) 2003--2004 Martin Mares <mj@ucw.cz>
+
+package Gallery::Generator;
+
+use strict;
+use warnings;
+
+use Image::Magick;
+use IO::Handle;
+
+BEGIN { import Gallery qw(%CF); }
+
+sub new() { return bless {}; }
+
+sub Start($) {
+ print "Generating thumbnails...\n"; STDOUT->autoflush(1);
+ my $notes = $CF{'MetaDataDir'} . "/notes";
+ open NOTES, ">$notes" or die "Unable to write to notes ($notes): $!";
+}
+
+sub Finish($) {
+ close NOTES;
+ print "Done.\n";
+}
+
+sub RawHTML($$) { }
+
+sub img($$$) {
+ my ($this, $orig, $annot) = @_;
+ my ($base, $ext) = ($orig =~ /^(.*)\.([^.]+)$/) or die "Unable to dissect name $orig";
+ print "$base: ";
+ my $p = new Image::Magick;
+ my $e;
+ my $img = $CF{"PhotoDir"} . $orig;
+ $e = $p->Read($img) and die "Error reading $img: $e";
+ my ($wo, $ho) = $p->Get('width', 'height');
+ my ($w, $h) = ($wo, $ho);
+ print "${w}x${h}";
+ $p->Strip;
+ if ($w > $CF{"ThumbW"}) {
+ my $s = $CF{"ThumbW"} / $w;
+ $w = $w * $s;
+ $h = $h * $s;
+ }
+ if ($h > $CF{"ThumbH"}) {
+ my $s = $CF{"ThumbH"} / $h;
+ $w = $w * $s;
+ $h = $h * $s;
+ }
+ $w = int($w);
+ $h = int($h);
+ print " -> ${w}x${h} ";
+ $p->Resize(width=>$w, height=>$h);
+ my $thumb = $CF{"ThumbDir"} . "$base-thumb.jpg";
+ $e = $p->Write($thumb) and die "Unable to write $thumb: $e";
+ print NOTES "$base $w $h $wo $ho\n";
+ print "OK\n";
+}
+
+1;
--- /dev/null
+# Simple Photo Gallery: Web Interface
+# (c) 2003--2005 Martin Mares <mj@ucw.cz>
+
+package Gallery::Web;
+import Gallery qw(%CF);
+
+use UCW::CGI;
+
+my $show_img;
+my $send_archive;
+
+my %args = (
+ 'i' => { 'var' => \$show_img, 'check' => '\d+' },
+ 'a' => { 'var' => \$send_archive }
+);
+
+sub new() {
+ UCW::CGI::parse_args(\%args);
+ if ($send_archive && $CF{'AllowArchives'}) {
+ require Gallery::Archive;
+ return new Gallery::Archive($send_archive);
+ } else {
+ return bless {};
+ }
+}
+
+sub error($) {
+ print "<p style='color:red'>Bad luck, the script is broken. Sorry.\n<p>$_[0]\n";
+ print "</body></html>\n";
+}
+
+our (@images, %widths, %heights, %widths_orig, %heights_orig, %imgno);
+
+sub load_notes() {
+ @images = ("");
+ %widths = ();
+ %heights = ();
+ %imgno = ();
+ my $notes = $CF{'MetaDataDir'} . "/notes";
+ open NOTES, $notes or die "Unable to read notes ($notes): $!";
+ while (<NOTES>) {
+ chomp;
+ my ($n, $w, $h, $wo, $ho) = split /\s+/;
+ push @images, $n;
+ $widths{$n} = $w;
+ $heights{$n} = $h;
+ $widths_orig{$n} = $wo;
+ $heights_orig{$n} = $ho;
+ $imgno{$n} = $#images;
+ }
+ close NOTES;
+}
+
+sub show_links($$$) {
+ my ($prev, $up, $next) = @_;
+ print "<p class=parent>";
+ print "<span class=back style='width: $CF{'BackW'}px; height: $CF{'BackH'}px'>";
+ print "<a href='$prev'><img src='$CF{'BackImg'}' width=$CF{'BackW'} height=$CF{'BackH'} alt='Back'></a>" if $prev ne "";
+ print "</span>\n";
+ print "<span class=fwd style='width: $CF{'FwdW'}px; height: $CF{'FwdH'}px'>";
+ print "<a href='$next'><img src='$CF{'FwdImg'}' width=$CF{'FwdW'} height=$CF{'FwdH'} alt='Forward'></a>" if $next ne "";
+ print "</span>\n";
+ print "<a href='$up'><img src='$CF{'ParentImg'}' width=$CF{'ParentW'} height=$CF{'ParentH'} alt='Up'></a>\n" if $up ne "";
+}
+
+sub Start($) {
+ my $title = UCW::CGI::html_escape($CF{"Title"});
+ print <<EOF ;
+Content-Type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+$CF{"HeadExtras"}
+<link rel=stylesheet href="$CF{"StyleSheet"}" type="text/css" media=all>
+<title>$title</title>
+</head><body>
+$CF{"TopExtras"}
+EOF
+ $UCW::CGI::error_hook = \&error;
+ load_notes();
+ if ($show_img ne "" && $show_img > 0 && $show_img <= $#images) {
+ show_links(($show_img > 1 ? ("?i=".($show_img-1)) : ""),
+ "?",
+ ($show_img < $#images ? ("?i=".($show_img+1)) : ""));
+ } else {
+ show_links($CF{'BackURL'}, $CF{'ParentURL'}, $CF{'FwdURL'});
+ print "<h1>$CF{'Title'}</h1>\n";
+ print "<h2>$CF{'SubTitle'}</h2>\n" if defined $CF{'SubTitle'};
+ }
+}
+
+sub Finish($) {
+ print "$CF{'BotExtras'}\n</body></html>\n";
+}
+
+sub RawHTML($$) {
+ my ($obj, $h) = @_;
+ print $h if $show_img eq "";
+}
+
+sub img($$$) {
+ my ($this, $orig, $annot) = @_;
+ my ($base, $ext) = ($orig =~ /^(.*)\.([^.]+)$/) or die "Unable to dissect name $orig";
+ $annot = UCW::CGI::html_escape($annot);
+ my $id = $imgno{$base} || 0;
+
+ if ($show_img ne "") {
+ if ($id == $show_img) {
+ print "<h1>$annot</h1>\n" if $annot ne "";
+ my $img = $CF{'PhotoUrlPrefix'} . $orig;
+ print "<p class=large><img src='$img' width=$widths_orig{$base} height=$heights_orig{$base} alt='$orig'>\n";
+ }
+ return;
+ }
+
+ my $thumb = $CF{'ThumbUrlPrefix'} . "$base-thumb.jpg";
+ my $w = $widths{$base} || 10;
+ my $h = $heights{$base} || 10;
+ my $side_w = $CF{"ThumbW"} + 2*$CF{"InteriorMargin"};
+ my $side_h = $CF{"ThumbH"} + 2*$CF{"InteriorMargin"};
+ my $box_w = $CF{"LeftW"} + $side_w + $CF{"RightW"};
+ my $box_h = $CF{"TopH"} + $side_h + $CF{"BotH"};
+ print "<div class=thf><div class=thumb>\n";
+ print "<img src='$CF{'TopImg'}' width=$box_w height=$CF{'TopH'} alt='' class=tt>\n";
+ print "<img src='$CF{'LeftImg'}' width=$CF{'LeftW'} height=$side_h alt='' class=tl>\n";
+ my $ol = $CF{'LeftW'} + $CF{'InteriorMargin'} + int(($CF{'ThumbW'} - $w)/2);
+ my $ot = $CF{'TopH'} + $CF{'InteriorMargin'} + int(($CF{'ThumbH'} - $h)/2);
+ my $tit = ($annot ne "") ? " title=\"$annot\"" : "";
+ my $url = ($CF{"ImageSubpages"} ? "?i=$id" : $orig);
+ print "<a href='$url'><img src='$thumb' width=$w height=$h alt='$orig'$tit class=ti style='left: ${ol}px; top: ${ot}px'></a>\n";
+ print "<img src='$CF{'RightImg'}' width=$CF{'RightW'} height=$side_h alt='' class=tr>\n";
+ print "<img src='$CF{'BotImg'}' width=$box_w height=$CF{'BotH'} alt='' class=tb>\n";
+ print "</div>\n";
+# if ($annot ne "") {
+# print "<p class=annot>$annot\n";
+# }
+ print "</div>\n\n";
+}
+
+1;
--- /dev/null
+$(eval $(dir-setup))
+
+$(call lib-copy, Gallery.pm)
+$(call lib-copy, $(addprefix Gallery/,Archive.pm Generator.pm Web.pm))
+
+$(call copy, $(addprefix nrt-blue/,back.png bot.png left.png next.png prev.png right.png top.png theme.pm style.css))
--- /dev/null
+#!/usr/bin/perl
+# Generate image gallery
+# (c) 2004--2007 Martin Mares <mj@ucw.cz>
+
+# Syntax of input file:
+# <filename> <datestamp> <rotation> <xform>
+# where <rotation> is either ".", "l", "r" or "u"
+# <xform> contains:
+# d touch output file to <datestamp>
+# D include <datestamp> in output file names
+# n normalize contrast
+# s sharpen
+# h equalize histogram
+
+use Image::Magick;
+use IO::Handle;
+
+use strict;
+use warnings;
+
+my $maxw = 1024;
+my $maxh = 768;
+my $recompress = 1;
+
+STDERR->autoflush(1);
+print STDERR "Searching for template file... ";
+
+my $tdir = "";
+my $templ;
+my $maxdepth = 10;
+while ($maxdepth--) {
+ my $t = "${tdir}gallery.cf";
+ if (-f $t) {
+ $templ = $t;
+ last;
+ }
+ $tdir .= "../";
+ last if ! -d $tdir;
+}
+if ($templ) {
+ print STDERR "$templ\n";
+} else {
+ print STDERR "NONE\n";
+}
+
+print "#!/usr/bin/perl\n\n";
+if ($templ) {
+ print "require \"$templ\";\n\n";
+ print "SetOptions(\n";
+} else {
+ print <<EOF
+use lib '/home/mj/WWW/gal';
+use Gallery;
+
+SetOptions(
+ "GalURL" => "/~mj/gal",
+ "GalDir" => "/home/mj/WWW/gal",
+ "Theme" => "nrt",
+EOF
+;
+}
+print <<EOF
+ "Title" => "Untitled"
+);
+Start();
+EOF
+;
+
+#`rm -f [0-9]*.{jpg,png} *.tmp`; $? && die;
+
+my $idx = 0;
+while (<STDIN>) {
+ chomp;
+ my ($src, $date, $rotate, $xform) = split (/\t+/, $_);
+ $idx++;
+ my $id = sprintf("%03d", $idx);
+ if ($xform =~ /D/) {
+ $id = "$date-$id";
+ $id =~ s/ /-/g;
+ }
+ my $dest;
+ my $is_jpeg = 0;
+ if ($src =~ /\.(jpg|JPG|jpeg)$/) {
+ $dest = "$id.jpg";
+ $is_jpeg = 1;
+ } elsif ($src =~ /\.png$/) {
+ $dest = "$id.png";
+ } else {
+ die "$src: Unknown image type";
+ }
+ my $tmp = "$dest.tmp";
+ print STDERR "$dest: $src ";
+
+ my $p = new Image::Magick;
+ my $e;
+ $e = $p->Read($src) and die "Error reading $tmp: $e";
+ $p->Strip;
+ $p->SetAttribute(quality=>90);
+ my ($w, $h) = $p->Get('width', 'height');
+ print STDERR "-> ${w}x${h} ";
+
+ my ($w0, $h0) = ($rotate eq "l" || $rotate eq "r") ? ($h, $w) : ($w, $h);
+ my ($ww, $hh) = ($w0, $h0);
+ if ($ww > $maxw) {
+ my $s = $maxw / $ww;
+ $ww = $ww * $s;
+ $hh = $hh * $s;
+ }
+ if ($hh > $maxh) {
+ my $s = $maxh / $hh;
+ $ww = $ww * $s;
+ $hh = $hh * $s;
+ }
+ $ww = int($ww);
+ $hh = int($hh);
+
+ if ($recompress ||
+ !$is_jpeg ||
+ $xform ne "" ||
+ $ww != $w0 || $hh != $h0) {
+ my $rot = 0;
+ if ($rotate eq "l") { $rot = 270; }
+ elsif ($rotate eq "r") { $rot = 90; }
+ elsif ($rotate eq "u") { $rot = 180; }
+ if ($xform =~ /s/) {
+ print STDERR "-> sharpen ";
+ $p->Sharpen(1);
+ }
+ if ($xform =~ /h/) {
+ print STDERR "-> equalize ";
+ $p->Equalize();
+ }
+ if ($xform =~ /n/) {
+ print STDERR "-> normalize ";
+ $p->Normalize();
+ }
+ if ($rot) {
+ print STDERR "-> rotate $rot ";
+ $p->Rotate(degrees=>$rot);
+ $rotate = ".";
+ }
+ if ($ww != $w0 || $hh != $h0) {
+ print STDERR "-> ${ww}x${hh} ";
+ $p->Resize(width=>$ww, height=>$hh);
+ }
+ $e = $p->Write($tmp) and die "Unable to write $tmp: $e";
+ } else {
+ `cp $src $tmp`; $? && die;
+ }
+
+ if ($is_jpeg) {
+ my $tran = "-optimize -copy none";
+ if ($rotate eq ".") { }
+ elsif ($rotate eq "l") { $tran .= " -rotate 270 -trim"; }
+ elsif ($rotate eq "r") { $tran .= " -rotate 90 -trim"; }
+ elsif ($rotate eq "u") { $tran .= " -rotate 180 -trim"; }
+ else { die "Unknown rotation type $rotate"; }
+ print STDERR "-> $tran ";
+ `jpegtran $tran <$tmp >$dest`; $? && die;
+ } else {
+ rename $tmp, $dest or die;
+ }
+
+ if ($xform =~ /d/) {
+ `touch -d "$date" $dest`; die if $?;
+ }
+
+ unlink $tmp;
+ print STDERR "... OK\n";
+ print "img(\"$dest\", \"\");\t\t# $src (${w0}x${h0})\n";
+}
+
+print "Finish();\n";
+
+`rm -f *.tmp`; $? && die;
--- /dev/null
+#!/usr/bin/perl
+# Merge photos from multiple sources
+# (c) 2008 Martin Mares <mj@ucw.cz>
+
+use Image::EXIF;
+use Data::Dumper;
+
+use strict;
+use warnings;
+
+my @pics = ();
+if (@ARGV) {
+ @pics = @ARGV;
+} else {
+ while (<STDIN>) {
+ chomp;
+ /^#/ && next;
+ /^$/ && next;
+ push @pics, $_;
+ }
+}
+
+my %seen = ();
+foreach my $f (@pics) {
+ my $e = new Image::EXIF($f);
+ my $i = $e->get_all_info();
+ if ($e->error) { print STDERR "EXIF error on $f: ", $e->error, "\n"; }
+ else {
+ #print STDERR Dumper($i), "\n";
+ my $o = $i->{'image'}->{'Image Orientation'} || "Top, Left-Hand";
+ if ($o eq "Top, Left-Hand") { $o = "."; }
+ elsif ($o eq "Right-Hand, Top") { $o = "r"; }
+ elsif ($o eq "Left-Hand, Bottom") { $o = "l"; }
+ elsif ($o eq "Bottom, Right-Hand") { $o = "d"; }
+ else {
+ print STDERR "Unrecognized orientation: $o\n";
+ $o = ".";
+ }
+ my $d = $i->{'image'}->{'Image Created'};
+ if (defined($d)) {
+ $d =~ s/^(\d{4}):(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})/$1$2$3-$4$5$6/ or die "Date parse error: $d";
+ } else {
+ print STDERR "Unrecognized data, skipping: $f\n";
+ next;
+ }
+ my $fn = $d;
+ if ($f =~ m{^\.\./orig/(\w+)/}) {
+ $fn = "$fn-$1";
+ }
+ if (defined $seen{$fn}) {
+ my $c = ++$seen{$fn};
+ $fn = "$fn-$c";
+ } else {
+ $seen{$fn} = 1;
+ }
+ print "ln -s '$f' '$fn.jpg'\n";
+ }
+}
--- /dev/null
+#!/usr/bin/perl
+# Scan images in a list or gqview collection and prepare them for gal-gen
+# (c) 2004--2007 Martin Mares <mj@ucw.cz>
+
+use Image::EXIF;
+use Data::Dumper;
+
+use strict;
+use warnings;
+
+my @pics = ();
+if (@ARGV) {
+ @pics = @ARGV;
+} else {
+ while (<STDIN>) {
+ chomp;
+ /^#/ && next;
+ /^$/ && next;
+ if (/^"(.*)"$/) {
+ push @pics, $1;
+ } else {
+ die "Parse error: $_";
+ }
+ }
+}
+
+foreach my $f (@pics) {
+ my $e = new Image::EXIF($f);
+ my $i = $e->get_all_info();
+ if ($e->error) { print STDERR "EXIF error on $f: ", $e->error, "\n"; }
+ else {
+ #print STDERR Dumper($i), "\n";
+ my $o = $i->{'image'}->{'Image Orientation'} || "Top, Left-Hand";
+ if ($o eq "Top, Left-Hand") { $o = "."; }
+ elsif ($o eq "Right-Hand, Top") { $o = "r"; }
+ elsif ($o eq "Left-Hand, Bottom") { $o = "l"; }
+ elsif ($o eq "Bottom, Right-Hand") { $o = "d"; }
+ else {
+ print STDERR "Unrecognized orientation: $o\n";
+ $o = ".";
+ }
+ my $d = $i->{'image'}->{'Image Created'} || "?";
+ if ($d ne "?") {
+ $d =~ s/^(\d{4}):(\d{2}):(\d{2}) (\d{2}:\d{2}:\d{2})/$1-$2-$3 $4/ or die "Date parse error: $d";
+ }
+ print "$f\t$d\t$o\tn\n";
+ }
+}
--- /dev/null
+.thf { margin: 0 0 0 0; padding: 0 0 0 0; float: left; border: none; }
+.thumb { position: relative; width: 154px; height: 134px; background-color: black; }
+.tt { position: absolute; top: 0; left: 0; }
+.tl { position: absolute; top: 14px; left: 0; }
+.ti { position: absolute; }
+.tr { position: absolute; top: 14px; right: 0; }
+.tb { position: absolute; bottom: 0; right: 0; }
+.annot { width: 154px; text-align: center; }
+IMG { border: none; }
+H1 { text-align: center; }
+H2 { text-align: center; margin-bottom: 3ex; }
+P { clear: both; }
+H2 { clear: both; }
+.parent { text-align: center; }
+.large { text-align: center; }
+.back { float: left; }
+.fwd { float: right; }
+A[href]:hover { background-color: #11001d; }
--- /dev/null
+
+PicturesPerRow: 5
+BGColor: #ffffff
+TextColor: #000000
+CommentColor: #000000
+FilmBGColor: #322207
+LinkColor: #000000
+ALinkColor: gold
+VLinkColor: #000000
+LinkSize: 1
+
+# linksize | top
+# | v
+# ------------------|---------------- ---
+# | | | |
+# ------------------v---------------- ---
+# | | ______________________ | | ^
+# | | | ^ | | | |
+# | | | | height | | |
+# | | | | | | |
+# l | | | | | | | right
+# --->|---| |<--|----width------->| |---|<-----
+# | | | | | | |
+# | | | | | | |
+# | | | | | | |
+# | | | v | | |
+# | | |---------------------| | | |
+# | | | | v
+# ----------------------------------- ---
+# | | |
+# ----------------------------------- ---
+# ^
+# | bottom
+#
+# total = left + linksize + width + linksize + right
+
+# Decorations: top bottom left right
+Decorations: 14 18 14 18
+ThumbWidth: 120
+ThumbHeight: 100
--- /dev/null
+# NRT Theme for MJ's Photo Gallery
+# (c) 2003--2004 Martin Mares <mj@ucw.cz>; GPL'ed
+# Theme images taken from the cthumb package (c) Carlos Puchol
+
+package Gallery::Theme;
+
+use strict;
+use warnings;
+
+sub Init($) {
+ my ($u) = @_;
+ Gallery::SetOptions(
+ "StyleSheet" => "$u/style.css",
+ "ThumbW" => 114,
+ "ThumbH" => 94,
+ "TopImg" => "$u/top.png",
+ "TopH" => 14,
+ "BotImg" => "$u/bot.png",
+ "BotH" => 18,
+ "LeftImg" => "$u/left.png",
+ "LeftW" => 14,
+ "RightImg" => "$u/right.png",
+ "RightW" => 18,
+ "InteriorMargin" => 4,
+ "ParentImg" => "$u/back.png",
+ "ParentH" => 48,
+ "ParentW" => 48,
+ "BackImg" => "$u/prev.png",
+ "BackH" => 48,
+ "BackW" => 48,
+ "FwdImg" => "$u/next.png",
+ "FwdH" => 48,
+ "FwdW" => 48
+ );
+}
+
+1;
--- /dev/null
+.thf { margin: 0 0 0 0; padding: 0 0 0 0; float: left; border: none; }
+.thumb { position: relative; width: 154px; height: 134px; background-color: black; }
+.tt { position: absolute; top: 0; left: 0; }
+.tl { position: absolute; top: 14px; left: 0; }
+.ti { position: absolute; }
+.tr { position: absolute; top: 14px; right: 0; }
+.tb { position: absolute; bottom: 0; right: 0; }
+.annot { width: 154px; text-align: center; }
+IMG { border: none; }
+H1 { text-align: center; }
+H2 { text-align: center; }
+P { clear: both; }
+H2 { clear: both; }
+.parent { text-align: center; }
+.large { text-align: center; }
+.back { float: left; }
+.fwd { float: right; }
--- /dev/null
+
+PicturesPerRow: 5
+BGColor: #ffffff
+TextColor: #000000
+CommentColor: #000000
+FilmBGColor: #322207
+LinkColor: #000000
+ALinkColor: gold
+VLinkColor: #000000
+LinkSize: 1
+
+# linksize | top
+# | v
+# ------------------|---------------- ---
+# | | | |
+# ------------------v---------------- ---
+# | | ______________________ | | ^
+# | | | ^ | | | |
+# | | | | height | | |
+# | | | | | | |
+# l | | | | | | | right
+# --->|---| |<--|----width------->| |---|<-----
+# | | | | | | |
+# | | | | | | |
+# | | | | | | |
+# | | | v | | |
+# | | |---------------------| | | |
+# | | | | v
+# ----------------------------------- ---
+# | | |
+# ----------------------------------- ---
+# ^
+# | bottom
+#
+# total = left + linksize + width + linksize + right
+
+# Decorations: top bottom left right
+Decorations: 14 18 14 18
+ThumbWidth: 120
+ThumbHeight: 100
--- /dev/null
+# NRT Theme for MJ's Photo Gallery
+# (c) 2003--2004 Martin Mares <mj@ucw.cz>; GPL'ed
+# Theme images taken from the cthumb package (c) Carlos Puchol
+
+package Gallery::Theme;
+
+use strict;
+use warnings;
+
+sub Init($) {
+ my ($u) = @_;
+ Gallery::SetOptions(
+ "StyleSheet" => "$u/style.css",
+ "ThumbW" => 114,
+ "ThumbH" => 94,
+ "TopImg" => "$u/top.png",
+ "TopH" => 14,
+ "BotImg" => "$u/bot.png",
+ "BotH" => 18,
+ "LeftImg" => "$u/left.png",
+ "LeftW" => 14,
+ "RightImg" => "$u/right.png",
+ "RightW" => 18,
+ "InteriorMargin" => 4,
+ "ParentImg" => "$u/back.png",
+ "ParentH" => 48,
+ "ParentW" => 48,
+ "BackImg" => "$u/prev.png",
+ "BackH" => 48,
+ "BackW" => 48,
+ "FwdImg" => "$u/next.png",
+ "FwdH" => 48,
+ "FwdW" => 48
+ );
+}
+
+1;