$NetBSD: patch-aa,v 1.2 2002/03/12 23:34:46 lukem Exp $ --- make_album.orig Fri Sep 15 07:43:30 2000 +++ make_album @@ -1221,10 +1221,14 @@ # sub read_cameras { my ($model, $camfile); + my (@camfiles) = ( + $ENV{"CAMERAS_TXT"}, + $ENV{"HOME"} . "/lib/cameras.txt", + $0 . "/../../lib/cameras.txt", + ); - if (!defined ($camfile = $ENV{"CAMERAS_TXT"})) { - $camfile = $ENV{"HOME"}."/lib/cameras.txt"; - } + foreach $camfile (@camfiles) { + next if ($camfile eq ""); if (open(CAMERAS, "<$camfile")) { $model = ""; @camera_models = (); @@ -1253,7 +1257,9 @@ } } close(CAMERAS); + return; } + } } # Get EXIF/other info about the image "$tag" @@ -1440,7 +1446,7 @@ print FILE ""; print FILE ""; print FILE ""; - print FILE "This img:\n"; + print FILE "This image:\n"; foreach $t (@tours) { if ($tour{$t}{"dir"} eq ".") { $d2 = ""; @@ -1454,20 +1460,8 @@ print FILE "" if ($t eq $tour); print FILE ""; } - print FILE "
Indices:"; - foreach $t (@tours) { - if ($tour{$t}{"dir"} eq ".") { - $d2 = ""; - } else { - $d2 = $tour{$t}{"dir"}."/"; - } - print FILE "
"; - print FILE "" if ($t eq $tour); - print FILE $t; - print FILE "" if ($t eq $tour); - print FILE ""; - } + print FILE "
Index"; + print FILE "
Parent directory"; print FILE "\n"; print FILE ""; if ($next) { @@ -1478,7 +1472,7 @@ print FILE "\n"; print FILE ""; if ($notes{$tag} ne "") { - print FILE $notes{$tag}; + print FILE "
$notes{$tag}
"; } print FILE "
".$x."x".$y." (best"; if ($x != $image{"master/$tag.tiff"}{"x"} || $y != $image{"master/$tag.tiff"}{"y"}) { @@ -1563,6 +1557,7 @@ print FILE ", " if ($comma); $comma = 1; print FILE "Focus: $m $f"; if ($f != 0 + && $f ne "infinite" && defined ($focal = $rexif->{"focal"}) && $focal ne "" && ($aperture = $rexif->{"fstop"}) ne "" @@ -1858,9 +1853,9 @@ %image = {}; foreach $tag (@tags) { - if (open(IDENTIFY, "identify -cache $im_cache -ping web/thumbs/$tag.jpg|")) { + if (open(IDENTIFY, "identify -cache $im_cache web/thumbs/$tag.jpg|")) { while () { - if (/^\S+\s+(\d+)x(\d+)/) { + if (/JPEG\s+(\d+)x(\d+)/) { $image{"thumbs/$tag.jpg"}{"x"} = $1; $image{"thumbs/$tag.jpg"}{"y"} = $2; } @@ -1890,9 +1885,10 @@ if ((! -f $file) && -f $file.".gz") { $file = $file.".gz"; } - if (open(IDENTIFY, "identify -ping $file|")) { + print "\t$file\n"; + if (open(IDENTIFY, "identify $file|")) { while () { - if (/^\S+\s+(\d+)x(\d+)/) { + if (/TIFF\s+(\d+)x(\d+)/) { $image{"master/$tag.tiff"}{"x"} = $1; $image{"master/$tag.tiff"}{"y"} = $2; $got_size = 1; @@ -1961,7 +1957,7 @@ print INDEX ""; } print INDEX ""; - print INDEX "Parent"; + print INDEX "
Parent directory"; foreach $section (sort {$a <=> $b} keys %section) { print INDEX "

".$section{$section}{"name"}."

\n";