For making contact prints from a directory
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
hum3 8d7a7f4477 Add recent paths, file explorer, labels under images, page footer
- Remember the last 10 opened paths in ~/.config/contact-print/recent.txt
  (SMB passwords never stored) and offer them as one-click buttons.
- Add a local-filesystem browse panel to the directory form.
- Draw each filename directly below its image's actual bottom edge with
  a fixed 18 px gap, so landscape images no longer get a large gap.
- Add a footer to every sheet: directory on the left (truncated if
  long), render date/time and page number on the right (never
  truncated).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:05:01 +01:00
internal Add recent paths, file explorer, labels under images, page footer 2026-07-05 14:05:01 +01:00
.gitignore Initial version: contact sheets with lofigui preview and CUPS printing 2026-07-05 12:07:11 +01:00
browse.go Add recent paths, file explorer, labels under images, page footer 2026-07-05 14:05:01 +01:00
go.mod Initial version: contact sheets with lofigui preview and CUPS printing 2026-07-05 12:07:11 +01:00
go.sum Initial version: contact sheets with lofigui preview and CUPS printing 2026-07-05 12:07:11 +01:00
history.go Add recent paths, file explorer, labels under images, page footer 2026-07-05 14:05:01 +01:00
main.go Add recent paths, file explorer, labels under images, page footer 2026-07-05 14:05:01 +01:00
print.go Initial version: contact sheets with lofigui preview and CUPS printing 2026-07-05 12:07:11 +01:00
README.md Add recent paths, file explorer, labels under images, page footer 2026-07-05 14:05:01 +01:00
web.go Add recent paths, file explorer, labels under images, page footer 2026-07-05 14:05:01 +01:00

contact-print

A small localhost web app (lofigui) that builds printable A4 contact sheets from a directory of photos and sends them to a CUPS printer.

  • Accepts a local path or an smb:// URL such as smb://humphrey@hdtlserver.local/hdtl/Jobs/0050 Ada (built-in SMB client, password asked for once, kept only in memory).
  • Remembers the last 10 paths you opened (in ~/.config/contact-print/recent.txt, SMB passwords never stored) and shows them as one-click buttons, plus a simple file explorer for browsing to a local directory.
  • Lists only the root images (IMG_2508.jpg, IMG_2518.jpg, …): .psd files and suffixed derivatives like IMG_2508_base_80wide.jpg are hidden.
  • Select the images and a grid of 4, 6, 9 or 12 per page; each cell shows the filename in bold 14 pt text directly below the image's bottom edge, whatever its aspect ratio.
  • Each sheet carries a footer with the source directory, the render date/time and the page number.
  • Sheets are rendered server-side as A4 300 DPI PNGs, so the browser preview is pixel-identical to what prints.
  • Print all pages (one CUPS job) or a single page via lp.

Usage

go build .
./contact-print                 # open the printed URL, e.g. http://127.0.0.1:8090

Flags:

Flag Default Purpose
--printer H3_ET_2850 CUPS destination
--print-hold off submit jobs held, for paperless testing (lpstat -o, then cancel JOB or lp -i JOB -H resume)
--port 8090 first port to try (scans up to +9)

Notes

  • JPEG EXIF orientation is honoured.
  • Thumbnails are cached in ~/.cache/contact-print/ keyed by file size and mtime, so re-renders don't re-fetch images over SMB.
  • Supported source formats: jpg, jpeg, png, tif, tiff.