lapse: Keep Burst Photos in Order on Google Photos

작성자

카테고리:

← 피드로
DEV Community · Daisuke Mino · 2026-07-09 개발(SW)

Daisuke Mino

I built lapse, a small CLI tool that makes the EXIF timestamps of burst-shot JPEGs unique so that Google Photos displays them in the order they were shot.

The problem

When you shoot a burst, many frames land within the same second. Cameras record the sub-second part in EXIF (SubSecTimeOriginal), but Google Photos ignores it — so photos taken in the same second lose their shooting order after upload.

What lapse does

lapse walks through the JPEGs in a directory in natural filename order (image_2.jpg before image_10.jpg) and assigns each file:

new time = max(original time, previous file's new time + 1 second)

Enter fullscreen mode Exit fullscreen mode

The first file keeps its original time. Only frames collapsed into the same second get pushed forward, one second at a time; separate scenes with real time gaps keep their original capture times. The result is monotonically increasing timestamps that match the filename order — which is enough for Google Photos to sort them correctly.

Files that already have unique timestamps are not touched at all, so re-running is idempotent. It’s a destructive operation by nature, so there’s a --dry-run flag to preview the rewrites first:

# Preview (no rewriting)
lapse --dry-run /path/to/photos

# Run
lapse /path/to/photos

Enter fullscreen mode Exit fullscreen mode

Lossless by construction

The part I cared most about: lapse never decodes or rebuilds the JPEG. It patches the date-time tag values (fixed 19 bytes each) in place inside the APP1 segment, so every other byte — including the image scan data, GPS tags, and MakerNote — is bit-identical before and after. Writes go to a temporary file followed by an atomic rename, so a crash mid-write can’t corrupt the original.

This is also why it’s a pure Rust implementation with an in-house minimal TIFF/IFD parser instead of depending on ExifTool or EXIF-writing crates: general-purpose writers rebuild segments and risk corrupting MakerNote offsets.

Try it

Prebuilt binaries for Linux, macOS, and Windows are on the Releases page, or build from source with Cargo. If you shoot bursts and organize them in Google Photos, give it a try.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다