Show HN: LocalPics – A zero-dependency local media viewer written in Go (github.com)

3 points by tuxxness ↗ HN
I have no found any simple, lightweight tools for quickly browsing media files on my computer. Sometimes I just want to view a folder of images, videos, or code files through a nice interface without uploading anything to the cloud or processing a lot of files for big directories.

So I built LocalPics, a portable Go application that creates a beautiful local web interface for browsing your media files. Point it at any directory, and it instantly serves a responsive web UI that categorizes and displays your files by type.

Features:

- Zero dependencies - Just a single binary, no installation required

- Fast scanning - Handles thousands of files quickly

- Responsive UI - Works on desktop and mobile browsers

- File categorization - Automatically groups files by type (images, videos, audio, code, etc.)

- EXIF data extraction - View camera details, GPS coordinates, and other metadata for images

- Syntax highlighting - Beautiful code previews with language detection

- Markdown rendering - Preview markdown files with proper formatting

- Local-only - Everything runs on your machine, no data ever leaves your computer

- Video and audio playback - Built-in players for media files

- Optional file deletion API - Can be enabled with a flag for pruning your collection

How it works:

LocalPics uses Go's standard library (no external dependencies) to scan a directory, categorize files, and generate JSON indexes and an HTML interface. It then starts a local HTTP server to serve these files, along with the original media.

The frontend is pure HTML, CSS, and JavaScript, leveraging a few CDN-served libraries like PrismJS for syntax highlighting and ExifJS for metadata extraction.

Usage:

Simply run:

localpics -indir ~/Pictures

And a web server will start at http://localhost:8080 where you can browse your files.

Additional options:

localpics -indir <input_directory> [-outdir <output_directory>] [-delete]

The source code is available at https://github.com/tuxx/localpics. It's under 1000 lines of Go code, making it easy to understand and modify.

2 comments

[ 3.1 ms ] story [ 12.2 ms ] thread
I'm a bit confuses. Is this meant to compete with native desktop software or with other web UIs?
It's not meant to compete with anything. It was made to fit my needs to have a media viewer for local directories that does zero processing of the files.