LightPhotos

Exporting to your own Immich server

LightPhotos can upload finished photos straight to any Immich server, even one on a box in your home. Here is how I made your server address and an API key work with no extra steps.

You type: Key: Check with:
1. Clean the address trim, drop / and /api typed photos.example.com clean https://photos.example.com 2. Find the API /.well-known/immich else /api API https://photos.example.com/api 3. Check the key before anything is saved ask GET /users/me reply “Connected as” your name and email Saves the address and the key.

No scheme typed, so LightPhotos adds https://.

Pick an address, a key and a check. Then try the invented key with each check.

Why Immich

I keep my originals in folders on a drive, and I will not change that. But nobody wants to browse a folder of JPEGs on a phone, and I will not give my photos to a service that I cannot leave. Immich is a real photo library with a phone app, on my own hardware or a hosted service. Before, I exported to a folder and uploaded it by hand. Now it is one step.

Accept any address that you type

People type photos.example.com, paste https://photos.example.com/api/ from the documentation, or use http://nas.local:2283 at home. All must work. LightPhotos trims spaces, removes a trailing slash or /api, and adds https:// if you left it off. Then it reads the discovery file of the server, /.well-known/immich, to find where the API lives. That helps people who host Immich under a sub-path, for example /immich/api. With no discovery file, it uses the usual /api.

If you type no scheme and HTTPS fails, LightPhotos does not silently fall back to plain HTTP, because that would send your API key across the network without encryption and without telling you. The error tells you to type http:// yourself if your server has no HTTPS. The decision is yours.

Check the key early

The usual connection test asks the server about itself. Gumnut, a hosted Immich service, answered that request for any key, even one that I invented. A wrong key looked fine until the first upload failed. So LightPhotos asks "who owns this key?" instead. Only a real key gets a reply, and the reply also gives the form "Connected as" with your name and email. Check a key with a request that needs the key.

LightPhotos saves nothing until that check passes. The address goes in the app settings. The key goes somewhere safer:

LightPhotos does not touch the Keychain until you open the Immich tab, so if you never use Immich, you never see a Keychain prompt.

What LightPhotos uploads

Immich gets the finished JPEG, rendered exactly as for a folder export with your edits, crop and size. Your originals stay on your drive. Two items go with it:

Running the same batch twice

An export can stop early when the laptop sleeps or the Wi-Fi drops. The easiest fix is to export again, so that must be safe. I let the server find duplicates. If you upload the same file twice, Immich replies "duplicate" and points to the photo that it already has. LightPhotos keeps no upload list that could fall out of sync with the server. It sends everything again, counts the duplicates and shows a message such as "Uploaded 40 photos, 32 already on the server." The batch picks up where it stopped.

Slow uploads that still work

Home connections are slow for uploads, and LightPhotos uploads several photos at once. My first version gave each upload a fixed five-minute limit. Large photos on a slow connection that eight uploads shared hit that limit, although the connection worked. Now each upload gets one minute plus extra time based on its size, calculated as if a 1 Mbit/s connection were split between eight uploads:

time allowed = 60 s
             + photo size / 16 KB per second
MINUTES, ONE UPLOAD AT 16 KB/S Upload needs New limit old limit: 5 min 0 10 20 30 40

25 MB: needs approximately 27 min. Old limit 5 min: fails. New limit: approximately 28 min.

Drag the photo size. The new limit always leaves one minute more than the upload needs at 16 KB/s.

A connection that is truly stuck still fails, because the other limits, to connect and to wait for the server reply, stay short.

Why it is not in the browser

A web page can talk to a server on another site only if that server gives permission. Immich does not, so the browser blocks the request before it sends it. The web version shows a note under Immich that it works only in the desktop app, which is not a web page.

What is next

Next is albums: pick an existing album or type a new name. After that, automatic retries for uploads that fail part way. Servers with self-signed certificates, common on home networks, probably will not connect yet. If you have one, please tell me.

Report problems on the issue tracker. The desktop builds are on the downloads page.