From 2a5b59a96af3d0713e9851d19121b60b95c2132f Mon Sep 17 00:00:00 2001 From: moonrise-outshoot <254815311+moonrise-outshoot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:52:50 +1000 Subject: [PATCH] Fix duplicate file detection in zip archives (#6493) When scanning a zip archive duplicate images are being detected as renames rather than duplicates. This is because in `scanJob.getFileFS` the size of the inner file (`my_archive.zip/001.png`) was being passed to `OpenZip` rather than the size of the zip archive (`my_archive.zip`), causing it to fail when opening the archive. This caused `handleRename` to incorrectly detect it as a rename. The effects of that are: - no info on duplicates in the file data - the file will take the name/path of the final duplicate scanned rather than the first --- pkg/file/scan.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/file/scan.go b/pkg/file/scan.go index 803457665..36b409c89 100644 --- a/pkg/file/scan.go +++ b/pkg/file/scan.go @@ -895,7 +895,8 @@ func (s *scanJob) getFileFS(f *models.BaseFile) (models.FS, error) { } zipPath := f.ZipFile.Base().Path - return fs.OpenZip(zipPath, f.Size) + zipSize := f.ZipFile.Base().Size + return fs.OpenZip(zipPath, zipSize) } func (s *scanJob) handleRename(ctx context.Context, f models.File, fp []models.Fingerprint) (models.File, error) {