summaryrefslogtreecommitdiff
path: root/www/make_album/patches/patch-aa
blob: 1f95d5578514696bba04e2275e3d92e89f5e66ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
$NetBSD: patch-aa,v 1.1.1.1 2001/12/26 08:00:58 lukem Exp $

--- make_album.orig	Fri Sep 15 07:43:30 2000
+++ make_album	Wed Dec 26 19:00:26 2001
@@ -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 "<img src=\"$tag.jpg\" height=\"$y\" width=\"$x\" />";
 	print FILE "</TD>";
 	print FILE "</TR><TR><TD>";
-	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 "</strong>" if ($t eq $tour);
 		print FILE "</a>";
 	}
-	print FILE "<hr />Indices:";
-	foreach $t (@tours) {
-		if ($tour{$t}{"dir"} eq ".") {
-			$d2 = "";
-		} else {
-			$d2 = $tour{$t}{"dir"}."/";
-		}
-		print FILE "<br /><a href=\"";
-		print FILE $home.$d2."index.htm#$tag\">";
-		print FILE "<strong>" if ($t eq $tour);
-		print FILE $t;
-		print FILE "</strong>" if ($t eq $tour);
-		print FILE "</a>";
-	}
+	print FILE "<hr /><a href=\"index.htm#$tag\">Index</a>";
+	print FILE "<hr /><a href=\"".($dir ne "." ? "../" : "")."../index.htm\">Parent directory</a>";
 	print FILE "</TD></TR>\n";
 	print FILE "<TR><TD>";
 	if ($next) {
@@ -1478,7 +1472,7 @@
 	print FILE "</TD></TR>\n";
 	print FILE "<TR><TD COLSPAN=2>";
 	if ($notes{$tag} ne "") {
-		print FILE $notes{$tag};
+		print FILE "<CENTER>$notes{$tag}</CENTER>";
 	}
 	print FILE "<br /><font size=\"-1\">".$x."x".$y." (best";
 	if ($x != $image{"master/$tag.tiff"}{"x"} || $y != $image{"master/$tag.tiff"}{"y"}) {
@@ -1858,9 +1852,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 (<IDENTIFY>) {
-			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 +1884,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 (<IDENTIFY>) {
-				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 +1956,7 @@
 		print INDEX "</td></tr>";
 	}
 	print INDEX "</table>";
-	print INDEX "<a href=\"".($dir ne "." ? "../" : "")."../index.htm\">Parent</a>";
+	print INDEX "<br><a href=\"".($dir ne "." ? "../" : "")."../index.htm\">Parent directory</a>";
 
 	foreach $section (sort {$a <=> $b} keys %section) {
 		print INDEX "<hr /><h2>".$section{$section}{"name"}."</h2>\n";