Aspect-preserved detail image with full-size download

Photo detail page previously showed a square crop of the source image. Now
generate an aspect-preserved medium JPEG (longest side 1600, quality 88)
and display that on the detail page instead. The original file is linked
from a click-through on the image and from a sidebar 'Full size' download
link.

Also skip regeneration of images/thumbs/medium when the destination is
already at least as new as the source, so a rebuild triggered by editing
one sidecar (or restarting the service) no longer redecodes and rescales
every photo.
This commit is contained in:
2026-07-02 01:53:23 +02:00
parent 7f7a51ceb5
commit d269c8b1b4
3 changed files with 117 additions and 12 deletions
+4 -1
View File
@@ -13,7 +13,9 @@
<a href="/" class="back-btn">← Back</a>
<div class="dlayout">
<div class="dimg-wrap">
<img src="/{{.Photo.File}}" alt="{{.Photo.Caption}}">
<a href="/{{.Photo.File}}" target="_blank" rel="noopener">
<img src="/{{.Photo.Medium}}" alt="{{.Photo.Caption}}">
</a>
</div>
<div class="dsidebar">
<div class="dauthor">
@@ -22,6 +24,7 @@
</div>
<p class="dcaption">{{.Photo.Caption}}</p>
<p class="ddate">{{.Photo.Date.Format "Jan 02, 2006"}}</p>
<p class="dfull"><a href="/{{.Photo.File}}" download>↓ Full size</a></p>
</div>
</div>
</div>