Skip to content

stack

Organize existing photos on your Immich server into stacks.

Synopsis

bash
immich-go stack [options]

Purpose

Stacking groups related photos without deleting anything:

  • Burst photos: Rapid-fire shots
  • RAW + JPEG: Camera saved both
  • HEIC + JPEG: iPhone saved both
  • Epson FastFoto: Scanned photo sets

Required Options

OptionDescription
-s, --serverImmich server URL
-k, --api-keyAPI key

Connection Options

OptionDefaultDescription
--skip-verify-sslfalseSkip SSL verification
--client-timeout20mRequest timeout
--api-tracefalseLog API calls

Behavior Options

OptionDefaultDescription
--dry-runfalsePreview without changes
--time-zoneSystemOverride timezone

Stacking Rules

Burst Photos

bash
immich-go stack --manage-burst=Stack --server=... --api-key=...
ValueBehavior
NoStackKeep separate (default)
StackStack all bursts
StackKeepRawStack, RAW as cover
StackKeepJPEGStack, JPEG as cover

Detected patterns:

DevicePattern
HuaweiIMG_*_BURST001_COVER.jpg
Google PixelPXL_*_MOTION-01.COVER.jpg
Samsung20231207_101605_001.jpg
Sony XperiaDSC_*_BURST*.JPG
Nexus*_BURST*_COVER.jpg
Nothing*_BURST*

Also detects photos taken within 900ms of each other.

RAW + JPEG

bash
immich-go stack --manage-raw-jpeg=StackCoverRaw --server=... --api-key=...
ValueBehavior
NoStackKeep separate (default)
StackCoverRawStack, RAW as cover
StackCoverJPGStack, JPEG as cover
KeepRawDelete JPEG
KeepJPGDelete RAW

HEIC + JPEG

bash
immich-go stack --manage-heic-jpeg=StackCoverJPG --server=... --api-key=...
ValueBehavior
NoStackKeep separate (default)
StackCoverHeicStack, HEIC as cover
StackCoverJPGStack, JPEG as cover
KeepHeicDelete JPEG
KeepJPGDelete HEIC

Epson FastFoto

bash
immich-go stack --manage-epson-fastfoto=true --server=... --api-key=...

Stacks scanner output:

  • image.jpg (original)
  • image_a.jpg (corrected) - becomes cover
  • image_b.jpg (back of photo)

Examples

Preview Changes

bash
immich-go stack \
  --server=http://localhost:2283 \
  --api-key=your-key \
  --manage-burst=Stack \
  --dry-run

Stack Bursts

bash
immich-go stack \
  --server=http://localhost:2283 \
  --api-key=your-key \
  --manage-burst=Stack

Stack RAW+JPEG with RAW Cover

bash
immich-go stack \
  --server=http://localhost:2283 \
  --api-key=your-key \
  --manage-raw-jpeg=StackCoverRaw

Full Organization

bash
immich-go stack \
  --server=http://localhost:2283 \
  --api-key=your-key \
  --manage-burst=Stack \
  --manage-raw-jpeg=StackCoverRaw \
  --manage-heic-jpeg=StackCoverJPG

Best Practices

1. Always Preview First

bash
immich-go stack --dry-run ...

2. One Type at a Time

bash
# First bursts
immich-go stack --manage-burst=Stack ...

# Then RAW+JPEG
immich-go stack --manage-raw-jpeg=StackCoverRaw ...

3. Backup Before Destructive Operations

Before using KeepRaw or KeepJPG:

bash
immich-go archive --from-immich \
  --from-server=... --from-api-key=... \
  --write-to-folder=/backup

4. Use Debug Logging

bash
immich-go stack \
  --log-level=DEBUG \
  --manage-burst=Stack \
  --server=... --api-key=... \
  2>&1 | tee stacking.log

Troubleshooting

Nothing Gets Stacked

  • Check that photos have expected timestamps
  • Verify filenames match device patterns
  • Use --api-trace to see server communication
  • Try --dry-run with --log-level=DEBUG

Unexpected Stacking

  • Review detection patterns for your devices
  • Time-based detection (900ms) may be too aggressive for some workflows

Performance Issues

  • Increase --client-timeout for large libraries
  • Process incrementally using archive/upload workflow with date ranges