惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
博客园 - 三生石上(FineUI控件)
S
Securelist
U
Unit 42
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Simon Willison's Weblog
Simon Willison's Weblog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog
T
Tenable Blog
The Hacker News
The Hacker News
The Register - Security
The Register - Security
IT之家
IT之家
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
P
Privacy & Cybersecurity Law Blog
博客园_首页
T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
A
Arctic Wolf
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
V2EX
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Cyberwarzone
Cyberwarzone
V
Visual Studio Blog
月光博客
月光博客
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
G
GRAHAM CLULEY
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Heimdal Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

Hacker News

Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line Building a Z-Machine in the worst possible language High-Level Rust: Getting 80% of the Benefits with 20% of the Pain GitHub - duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. How to build a `git diff` driver · Jamie Tanna | Software Engineer Center for Responsible, Decentralized Intelligence at Berkeley The Local Universe’s Expansion Rate Is Clearer Than Ever, but Still Doesn’t Add Up - A new synthesis of astronomical measurements confirms a persistent mismatch that could point to physics beyond current models The air throughout our homes is infused with microplastics. But there are things you can do to breathe less of them The disturbing white paper Red Hat is trying to erase from the internet – OSnews The Future of Everything is Lies, I Guess: Annoyances ‘Abhorrent’: the inside story of the Polymarket gamblers betting millions on war Productive procrastination — Max van IJsselmuiden maps, territory and LMs 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job The Seasons are Wrong Artemis II crew splashes down near San Diego after historic moon mission We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs How a dancer with ALS used brainwaves to perform live On filing the corners off my MacBooks Installing every* Firefox extension OpenClaw’s memory is unreliable, and you don’t know when it will break Steve Blank Nowhere Is Safe Chimpanzees in Uganda locked in vicious 'civil war', say researchers watgo - a WebAssembly Toolkit for Go linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. Founding Product Engineer at Bild AI | Y Combinator A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace Cooperative Vectors Introduction | Evolve Keeping a Postgres queue healthy — PlanetScale Our response to the Axios developer tool compromise Do Americans read print books, e-books or audiobooks more? The Zettelkasten Method in Obsidian: A Practical Setup Guide Artemis II Is Competency Porn and We Are Starving For It WeakC4 Flight Viz — Cockpit View A Mexican surveillance giant you’ve never heard of is now watching the U.S. border Surelock: Deadlock-Free Mutexes for Rust RISC-V 101 – what is it and what does it mean for Canonical? | Ubuntu The Problem That Built an Industry How Much Linear Memory Access Is Enough? | Solidean Investigating Split Locks on x86-64 Simplest hash functions Sybilproof reputation mechanisms (2005) [pdf] What is a property? How Complex is my Code? Static code analysis in Kotlin — tools overview Toffoli gates are all you need PGLite evangelism dcmake: a new CMake debugger UI Clojure on Fennel part one: Persistent Data Structures Fragments: April 2 Python Release Python install manager 26.1 The Life and Death of the Book Review - Liberties Introducing Database Traffic Control — PlanetScale Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Building slogbox Apple Silicon and Virtual Machines: Beating the 2 VM Limit Who was “Not Even Wrong” first? Pokemon Evolution Vs Darwinian Evolution The APL Programming Language Source Code
phloto for my photo flow
evakhoury · 2026-05-27 · via Hacker News

I’ve been taking photos lately. You can see them here.

I wasn’t satisfied with my flow for tagging, encoding, and deploying these to my site; so I wrote a houseplant program to help. If you’re interested, you can see the code here–but, fair warning, it’s only meant to be useful to me.

A gallery in phloto, light mode

A gallery in phloto, light mode

A gallery in phloto, light mode

A gallery in phloto, light mode

Digital photo development

When I’m developing a photo, I run through these steps:

  1. I take a picture.

    The camera captures a RAW file with the image sensor data. The camera embeds metadata: the camera model, lens model, timestamp, F-stop and shutter speed, etc.

    This file has more data than we typically shunt around the web. My camera has 14 bits of resolution (sensitivity) in each color channel; most displays still only have 8 bits / channel of color resolution.

  2. I develop the RAW file.

    Using Darktable, RAWPower, or some other software,1 I process the photos. After triaging,2 I make choices like cropping, exposure, white balance…

    For the photos that I’m happy with, I export a then export a developed image: a lossless 16-bit PNG. These are very large files–in some cases, >100MB.

  3. I convert the photo for the web.

    The lossless, high-bit-depth image is good for archives; but for the web, I need something smaller, and without a “lossless” requirement. I transcode the image into a web-safe image in the WebP format.3

    I also create scaled-down versions. The “featured image” I have in the articles list winds up being a lot smaller on your screen than the original; why bother sending the extra bits around?

    The web versions also need to have filtered metadata. I’d like to be able to GPS-tag my photos for my own usage; but I don’t want to put the coordinates of my backyard on my web site.

  4. I write captions and alt-text for each image.

    These go into the album page; but I try to embed these as additional metadata fields in the image.

Motivating issues

Before writing phloto, my process was to do (1) with the camera, (2) with RAWPower,4 (3) with Hugo’s image filters, and (4) in the text of the Hugo page.

This process fell down in a couple places.

Portability

When I started doing more photography, I used Darktable for steps (2) and (4). It’s a really neat piece of software! It took me a while to understand Darktable’s flow; and even then I’m using a fraction if its power.

Even as I grew more comfortable using Darktable, I still found “open up the computer” to be a psychological barrier to doing image triage and editing. Using a computer for this task made “deal with photos” that much more like a job or a chore.

I wound up getting a refubished iPad, with the explicit goal of using it for photo processing on the go. It lives in my camera bag rather than at my desk. Unfortunately, an iPad can’t run Darktable.

Metadata loss

RAWPower and Nitro, in step (2), did not carry all metadata from the RAW file into the developed PNG. Only Darktable (of the software I’ve tried) allows editing the title and description metadata fields.

The most frustrating bit: Hugo sometimes silently fails to extract Exif metadata from PNG and WebP images. I can’t “just” pull the caption (title) and alt text (description) out of the image, even if I’ve set it. (I’ll file a bug to Hugo for this.)

Transcoding

I was using Hugo itself for step (3), which required putting the developed files into my Git repository. Remember, these are not yet compressed; one gallery can run to over a gigabyte of data!

Modern image compression techniques are very good at shrinking file size, but they are very CPU-intensive;5 they take time. With two galleries, the rebuild took about four minutes. Even worse, I didn’t have Hugo caching set up properly,6 so just about every build was taking this long.

I set out with these requirements:

  • Web-based. The server should be accessible from my iPad, where I do the development (step 2), and from my computer where I make the final site change.

  • Edit Exif title and description. I want to treat captions and alt-text as an “image” step, not as a “web” step.

  • Transcode with filtered Exif metadata. I want to have my “public-safe” Exif tags set up-front, and have code that I’m in charge of do the filtering. I want to do the transcode approximately once, rather than spending redudnant CPU cycles.

phloto does the above. It’s a hodgepodge of untested glue between the hyper HTTP server, image and zenwebp codecs, and my fork of the kamadak-exif library.

It’s houseplant software, with no effort to be suitable for anyone other than me. So, y’know, don’t use it. But it does do some neat tricks; read on for some inspiration!

A portion of New York skyline, with the dawn backlighting the buildings to the right. Steam rises in front of some buildings. This image brought to you by phloto.

Nondestructive editing of metadata

Most RAW development software uses “nondestructive editing”: they don’t modify the RAW file, ever. Instead, they write a “sidecar” file (usually in the XMP format) that describes what modifications/interpretations to apply to the RAW data. The software can “replay” a RAW+XMP to get the developed file (PNG).

I wanted phloto to, similarly, treat the RAW and developed files as read-only.7 But I didn’t want to deal with XMP, nor did I want to maintain a database (as Darktable does).

phloto’s hack is to read back metadata, in priority order, from each of the three files:

  1. an existing web file, if available
  2. the developed image (PNG)
  3. the RAW file

The highest-priority value is kept, i.e. the first value read in the above list. When I update metadata, phloto writes out a new web file–so the new value takes the highest priority.

Peeking at containers to avoid transcodes

In my initial implementation, phloto re-encoded every time the metadata changed. This was Not Great, as re-transcoding results in redundant work… and takes a long time!

Luckily (?) I wound up having a mostly-complete WebP parser from an earlier stage of the project.8 Using that, phloto can open up the WebP container without actually decoding the image, replace only the Exif data, and write the updated file back.

Now my problem is that updates are too fast–the visual feedback “I’m working on this update” disappears before I see it!

Note that an image can get re-transcoded if the developed file (PNG) is newer than the web file (WebP). If I want to go back and re-develop an image, I can still do that.

htmx is great

I’ve wanted to use htmx for a while, but I haven’t really had any projects that warrant it. Everything I’ve been doing has been either exclusively server-side or exclusively client-side. This was a nice opportunity to try it out!

htmx handles a couple things that make the interface snappy and interactive:

  • The first time an image is loaded, phloto doesn’t have a web-friendly version of it.9 phloto kicks off a background transcode… and via a little htmx, tells the browser to re-load the fragment of HTML around the image.

    This is an htmx load poll. While the transcode is ongoing, the placeholder (and poll directive) remain in place. When the transcode is done, phloto serves a new HTML fragment, without the poll–and with a texual indicator, “webp”, that indicates the transcode is done.

  • The metadata update runs through a form element handled by htmx. When the form submission completes, phloto serves back an HTML fragment that replaces the existing form, with data read back from the file that was written, giving a confirmation that the update is complete.

Future steps

I find myself confused as to whether the metadata is up to date, e.g. if I hit “submit”. I probably will want to add an indicator for this.

phloto could be a little snappier at listing the contents of large directories. Each listing of an album page has multiple “find and parse the sources for this image” calls; caching those would probably provide a good speedup.

I might want to expose metrics, e.g. “how many transcodes are in flight”.

There is the outstanding bug where Hugo is not able to read metadata from some files; I might need to fix this, if the issue lies with phloto or my webp editor. But I might bypass this, either by having phloto generate markdown sources (with alt-text and caption pre-filled), or by moving my site away from Hugo.

That said, phloto meets the requirements I was looking for. Other than a little styling, and optionally cleaning up some of the code organization, I don’t think there’s a much to add.


  1. I’m taking recommendations! I like the power and flexibility of Darktable, but I want something that I can run on an iPad so I don’t have to do my editing on a full-on computer. ↩︎

  2. I still have a lot to learn about composition and exposure. I discard a lot of captures. ↩︎

  3. As well as JPEG as a backup, but WebP support is common in modern browsers. I’m curious about HEIC, which in principle should be able to preserve more of the color depth. But I need to gather more data before adding more transcoders. ↩︎

  4. Though I’m mostly using RAWPower, I like Darktable better; it has a lot more capability, and the options/stages are clearer. However, I’ve found that having to pull out my laptop makes it less likely that I will actually develop the image. I have an iPad that I can keep in my bag and pull out when I have a free moment, and my photo development time has significantly increased. ↩︎

  5. The Webp and AVIF formats are based on the VP8 and AV1 video codecs. VP9 was so CPU-intensive it motivated custom silicon, Google’s Video Coding Unit; that’s the same kind of computation these formats need ofr transcoding. ↩︎

  6. I think I have now fixed this; a local rebuild takes about a second. I’m still using Hugo for resizing operations, which involve a WebP -> WepP transcoding, and for WebP -> JPEG transcoding; so this speed is probably only possible if those operations get memoized. ↩︎

  7. phloto treats the “archive directory”, containing RAW and developed files, separately from the “web directory” where it writes output; a consequence of how my directory tree is set up. Happily, this makes it easy to configure systemd to enforce this restriction! The systemd unit I use has the archive directory under ReadOnlyPaths=, and the web directory under ReadWritePaths=; phloto can’t clobber the RAW or developed files, because systemd won’t let it. ↩︎

  8. Earlier in the project, I was looking for an encoder library that could do both (a) lossy WebP and (b) add Exif data. The image crate can do (b) but not (a), lossless webp only; the libwebp crate does (a) but not (b). One possible solution was to decode the WebP container and insert an Exif chunk. With the help Kevan Hollbach (pairing at RC) I got a mostly-complete WebP container parser / editor ready. Then I found the zenwebp library, which does both, so I shelved the container parser…for a bit. ↩︎

  9. I do not advise telling Firefox to load multiple 70MB PNGs at once. ↩︎