summary refs log tree commit diff
path: root/www/photo.causal.agency/generate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'www/photo.causal.agency/generate.sh')
-rw-r--r--www/photo.causal.agency/generate.sh34
1 files changed, 31 insertions, 3 deletions
diff --git a/www/photo.causal.agency/generate.sh b/www/photo.causal.agency/generate.sh
index 4b30db92..558b8a54 100644
--- a/www/photo.causal.agency/generate.sh
+++ b/www/photo.causal.agency/generate.sh
@@ -15,14 +15,14 @@ resize() {
 preview() {
 	local photo=$1
 	local preview=preview/${photo##*/}
-	resize $photo 25% static/$preview
+	resize $photo 1500000@ static/$preview
 	echo $preview
 }
 
 thumbnail() {
 	local photo=$1
 	local thumbnail=thumbnail/${photo##*/}
-	resize $photo 5% static/$thumbnail
+	resize $photo 60000@ static/$thumbnail
 	echo $thumbnail
 }
 
@@ -41,6 +41,26 @@ page_title() {
 page_head() {
 	local date=$1
 	local title=$(page_title $date)
+	local lens film
+
+	if test -f $date/lens; then
+		lens=$(encode $date/lens)
+	else
+		lens=$(
+			identify -format '%[EXIF:LensModel]' \
+				$date/$(ls -1 $date | head -n 1) 2>/dev/null |
+			sed '
+				s/\([A-Z]\)\([0-9]\)/\1 \2/
+				s,f/,ƒ/,
+				s/\([0-9]\)-\([0-9]\)/\1–\2/g
+			' |
+			encode
+		)
+	fi
+	if test -f $date/film; then
+		film=$(encode $date/film)
+	fi
+
 	cat <<-EOF
 	<!DOCTYPE html>
 	<meta charset="utf-8">
@@ -48,12 +68,14 @@ page_head() {
 	<link rel="alternate" type="application/atom+xml" href="../feed.atom">
 	<title>${title}</title>
 	<style>
-	html { color: #bbb; background-color: black; font-family: sans-serif; }
+	html { color: #bbb; background-color: black; font-family: monospace; }
+	p { text-align: center; }
 	figure { margin: 1em; padding-top: 0.5em; text-align: center; }
 	img { max-width: calc(100vw - 2.5em); max-height: calc(100vh - 2.5em); }
 	details { max-width: 78ch; margin: 0.5em auto; }
 	</style>
 	<h1>${title}</h1>
+	<p>📷 ${lens}${film:+ 🎞️ }${film:-}</p>
 	EOF
 }
 
@@ -89,10 +111,16 @@ page_photo() {
 			<img src="../${preview}" alt="$(encode $description)">
 		</a>
 		<figcaption>
+	EOF
+	if test -n "${ExposureTime}"; then
+		cat <<-EOF
 			${ExposureTime} ·
 			ƒ/$(bc -S 1 -e ${FNumber}) ·
 			$(bc -e ${FocalLength}) mm ·
 			${PhotographicSensitivity} ISO
+		EOF
+	fi
+	cat <<-EOF
 			<details>
 				<summary>description</summary>
 				$(encode $description)