> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gumnut.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Duplicate Detection

> Learn how Gumnut avoids storing exact duplicate photo and video uploads

Gumnut automatically avoids storing an exact duplicate more than once in the
same library. This applies whether you upload through the Gumnut web app, an
Immich app, the REST API, an SDK, or an AI assistant.

## What Counts as a Duplicate

Gumnut compares the contents of each uploaded file using a SHA-256 checksum. A
file is a duplicate when its bytes exactly match a file that already exists in
the target library.

Renaming a file or changing its filesystem timestamps does not create a new
copy as long as the file contents stay unchanged. Upload metadata such as the
source device identifier is not used to decide whether files are duplicates.

Files that look alike but have different bytes are separate assets. For
example, Gumnut does not currently group or remove:

* Edited, cropped, or resized copies
* Re-encoded versions of the same photo or video
* Screenshots of an existing photo
* Similar burst photos

## What Happens When You Upload a Duplicate

Gumnut keeps the existing asset and does not store a second copy or charge its
bytes against storage again. The existing asset keeps its current metadata.

Duplicate detection is scoped to a library. If your account has multiple
libraries, the same file can exist once in each library.

When you upload directly to an album, Gumnut can add the existing asset to that
album without creating another library copy. If the asset is already in the
album, the album membership is left unchanged.

<Note>
  For API clients, `POST /api/assets` returns `201 Created` for a new asset and
  `200 OK` with the existing asset when the upload is an exact duplicate.
  Storage limits are checked first, so an account or library already at its
  storage cap receives `507 Insufficient Storage` even for a duplicate upload.
</Note>

## Duplicates in Trash

Trash remains part of the library until an asset is permanently deleted. If an
upload matches an asset in Trash, Gumnut returns that trashed asset instead of
creating or restoring it. Restore the asset from Trash if you want it to appear
in your library again.

## Duplicate Management

Gumnut does not currently provide a duplicate-management view for finding and
reviewing visually similar assets. Automatic upload deduplication only prevents
additional copies of files whose contents match exactly.
