Project

xferase

0.01
No release in over a year
Import/rename photos & videos from one directory to another.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.14
~> 3.10

Runtime

~> 0.2
~> 0.1, >= 0.1.5
~> 0.10
 Project Readme

πŸ”€ferase

All your photos under one roof.

Xferase is an always-on background service that automatically imports pictures & videos into your personal photo library as they come in.

When combined with other software, it can be used as a kind of self-hosted / DIY alternative to cloud photo services like Google Photos or iCloud.

Why?

My photo library has always been a hot mess. I have photos from my cell phone, photos from my digital camera, and photos I’ve gotten from other people. Some live in the cloud, some live on my cell phone, some live on my laptop, some live on a backup drive in my shoe closet, and others will sit on my digital camera’s SD card for a couple weeks before I remember that I wanted to share them with someone.

I got tired of taking lots of photos and then having to look in three places to find the ones I wanted. I just wanted my old photos to live in the same place as my new photos, plus a few other modest requirements:

  1. automatic photo import from any source*

    β€œAutomatic” means no mouse/keyboard interaction:

    • πŸ“± cell phone pictures get imported as soon as they’re taken;
    • πŸ’¬ chat app downloads, as soon as they’re saved;
    • πŸ“· digital camera pictures, as soon as it’s plugged into USB.
  2. master copy of library stored locally, on disk

    My digital photo/video library belongs to me. But if I don’t own the pipeline for storing and managing it, then does it really? πŸ€”

    Cloud services can raise their prices, go offline, or fall victim to ransomware attacks. My own Internet can fail, too. I’m happy to use the cloud for Netflix & Spotify, but for something as personal and unreplaceable as my photos, I want the master copy in my own hands.

  3. automatic syncing of library back to phone*

    Obviously, I don’t just want to collect my personal photos; I want to use them, and to have them with me wherever I go. But your complete photo collection is probably too large to fit on your cell phone, which is why Google and Apple host it in the cloud.

    Xferase gets around this by maintaining two parallel copies of your library: one master, and one optimized for web. Keep both on your computer and sync the latter to your phone; Xferase will make sure that when a photo is deleted from one, it’s automatically removed from the other, too.

  4. clean, consistent, user-visible directory & filename scheme

    Call me obsessive-compulsive, but which would you rather haveβ€”

    # this?                                 # ...or this?
    
    ~/Pictures                              ~/Pictures
    β”œβ”€β”€ 1619593208911.jpeg                  β”œβ”€β”€ 2020
    β”œβ”€β”€ DCIM                                β”‚   β”œβ”€β”€ 2020-08-01_113129.heic
    β”‚   └── 2021_03_26                      β”‚   └── 2020-05-20_160209.png
    β”‚       β”œβ”€β”€ R0014285.MOV                └── 2021
    β”‚       β”œβ”€β”€ R0014286.DNG                    β”œβ”€β”€ 2021-02-12_081933a.jpg
    β”‚       β”œβ”€β”€ R0014286.JPG                    β”œβ”€β”€ 2021-02-12_081933b.jpg
    β”‚       β”œβ”€β”€ R0014287.DNG                    β”œβ”€β”€ 2021-02-12_081939.mp4
    β”‚       └── R0014287.JPG                    β”œβ”€β”€ 2021-03-26_161245.mp4
    β”œβ”€β”€ IMG_20210212_081933_001.jpg             β”œβ”€β”€ 2021-03-26_161518.dng
    β”œβ”€β”€ IMG_20210212_081933_002.jpg             β”œβ”€β”€ 2021-03-26_161518.jpg
    β”œβ”€β”€ IMG_8953.HEIC                           β”œβ”€β”€ 2021-03-26_170304.dng
    β”œβ”€β”€ Screenshot_20200520_160209.png          β”œβ”€β”€ 2021-03-26_170304.jpg
    └── VID_20210212_081939.mp4                 └── 2021-04-28_000008.jpg

    I also want to know where my files are so I can find them in a β€œBrowse...” dialog or mirror them to other devices with Dropbox, Syncthing, or even rsync.

  5. available on Linux

    Xferase has not been tested on macOS, but it should work when run in a Docker container.

*Caveat

For points 1 and 3, Xferase needs the help of additional software (Syncthing & systemd). If you have no experience (or interest in) tinkering with Linux, Xferase is not for you.

See the next section for more details.

What Exactly Does It Do?

Xferase watches a directory of your choosing (its β€œinbox”), and whenever any files are placed there, it automatically optimizes and imports them into your photo library, like so:

# Before                                # After

~/Pictures                              ~/Pictures
β”œβ”€β”€ .inbox                              β”œβ”€β”€ .inbox
β”‚   β”œβ”€β”€ 1619593208911.jpeg              └── library
β”‚   β”œβ”€β”€ DCIM                                β”œβ”€β”€ 2020
β”‚   β”‚   └── 2021_03_26                      β”‚   β”œβ”€β”€ 2020-08-01_113129.heic
β”‚   β”‚       β”œβ”€β”€ R0014285.MOV                β”‚   └── 2020-05-20_160209.png
β”‚   β”‚       β”œβ”€β”€ R0014286.DNG                └── 2021
β”‚   β”‚       β”œβ”€β”€ R0014286.JPG                    β”œβ”€β”€ 2021-02-12_081933a.jpg
β”‚   β”‚       β”œβ”€β”€ R0014287.DNG                    β”œβ”€β”€ 2021-02-12_081933b.jpg
β”‚   β”‚       └── R0014287.JPG                    β”œβ”€β”€ 2021-02-12_081939.mp4
β”‚   β”œβ”€β”€ IMG_20210212_081933_001.jpg             β”œβ”€β”€ 2021-03-26_161245.mp4
β”‚   β”œβ”€β”€ IMG_20210212_081933_002.jpg             β”œβ”€β”€ 2021-03-26_161518.dng
β”‚   β”œβ”€β”€ IMG_8953.HEIC                           β”œβ”€β”€ 2021-03-26_161518.jpg
β”‚   β”œβ”€β”€ Screenshot_20200520_160209.png          β”œβ”€β”€ 2021-03-26_170304.dng
β”‚   └── VID_20210212_081939.mp4                 β”œβ”€β”€ 2021-03-26_170304.jpg
└── library                                     └── 2021-04-28_000008.jpg

(You may have noticed that this is identical to the snippet from above, except for the .inbox and library parent directories.)

How you get those files from your phone or camera into the inbox is up to you.

🀷 Up to me?? I thought Xferase was supposed to β€œimport from many sources”.

Yes, but only with the help of other software. Automatically getting files from other devices onto your computer is not a trivial problem, and there are existing utilities that already do it better than Xferase could.

Consider that different users may have a different technical requirements:

  • Should digital camera photos be transferred over USB, or using a Wi-Fi SD card?
  • Should cell phone photos be transferred over cellular data, or only over Wi-Fi?
  • How many other devices should the library be mirrored/synced to?

Limiting the scope of what Xferase does gives you the flexibility to use the best available tools for your needs, every step of the way.

Here is a diagram outlining the recommended approach:

For more on each step, see the guides below.

Quick Start

πŸ’‘ The examples below assume you have Docker installed.

Why use Docker? Xferase can be installed natively as a Ruby gem, but there are lots of external dependencies.

Basic Usage

$ docker run -d \
    --name xferase \
    --user $(id -u) \
    --env TZ=$(timedatectl show --property=Timezone --value) \
    --volume $HOME/Pictures:/data \
    --env INBOX=/data/.inbox \
    --env LIBRARY=/data/master \
    rlue/xferase

Any photos or videos placed in the inbox will be automatically moved to the library, with videos being compressed to save space on disk.

Option: LIBRARY_WEB

$ docker run -d \
    --name xferase \
    --user $(id -u) \
    --env TZ=$(timedatectl show --property=Timezone --value) \
    --volume $HOME/Pictures:/data \
    --env INBOX=/data/.inbox \
    --env LIBRARY=/data/master \
    --env LIBRARY_WEB=/data/web \
    rlue/xferase

Xferase will create a separate, lo-res copy of each imported file and save it to the web-optimized library.

Xferase keeps both libraries in sync, meaning that when a photo is deleted from one, it will be automatically deleted from the other.

⚠️ Warning

This also applies to copies of the same image in different formats: if you shoot RAW+JPEG, deleting a .jpg will cause Xferase to delete the corresponding raw image file (and vice versa).

Better yet: Using Docker Compose

With Docker Compose, you can store your deployment parameters in a static configuration file:

# docker-compose.yml

version: '3.4'

services:
  xferase:
    image: rlue/xferase:latest
    container_name: xferase
    user: 1000:1000
    environment:
      TZ: America/Los_Angeles
      INBOX: /data/.inbox
      LIBRARY: /data/master
      LIBRARY_WEB: /data/web
    volumes:
      - $HOME/Pictures:/data
    restart: unless-stopped

Guides

1. Upload (with systemd/Syncthing)

2. Ingest (with Xferase)

3. Propagate (with Syncthing)

License

Β© 2021 Ryan Lue. This project is licensed under the terms of the MIT License.