This is what I call the "duplicate path" issue: 2+ lines share the same images.path value.
MariaDB [pwggit]> select id, file, path, md5sum from piwigo_images order by id desc limit 3;
+-----+-------------------+-------------------------------------------------+----------------------------------+
| id | file | path | md5sum |
+-----+-------------------+-------------------------------------------------+----------------------------------+
| 231 | image.png | ./upload/2025/07/14/20250714124155-d995763d.png | d995763d1e8cb0226dd884520a9f8e7d |
| 230 | image copy.png | ./upload/2025/07/14/20250714124154-d995763d.png | d995763d1e8cb0226dd884520a9f8e7d |
| 229 | image copy 2.png | ./upload/2025/07/14/20250714124154-d995763d.png | d995763d1e8cb0226dd884520a9f8e7d |
+-----+-------------------+-------------------------------------------------+----------------------------------+
3 rows in set (0.001 sec)
The 3 files are identical (same md5sum). We upload them in the same batch and with the "new" option "Detect and avoid duplicates during upload" deactivated.
As we can see, photo#229 and photo#230 end up with the exact same path because they're uploade in the same second and share the same md5sum. This is a real problem because if you delete photo#229 it will generate a missing file for photo#230 😥
to avoid generating duplicate paths, we should introduce more randomness in the file path before writing file during upload
to fix the existing duplicate paths, plugin Check Uploads will get a "deduplicate" action
to avoid generating missing files, we should add a check during deletion : if the path is shared with another image, we should not delete the file
This is what I call the "duplicate path" issue: 2+ lines share the same `images.path` value.
```
MariaDB [pwggit]> select id, file, path, md5sum from piwigo_images order by id desc limit 3;
+-----+-------------------+-------------------------------------------------+----------------------------------+
| id | file | path | md5sum |
+-----+-------------------+-------------------------------------------------+----------------------------------+
| 231 | image.png | ./upload/2025/07/14/20250714124155-d995763d.png | d995763d1e8cb0226dd884520a9f8e7d |
| 230 | image copy.png | ./upload/2025/07/14/20250714124154-d995763d.png | d995763d1e8cb0226dd884520a9f8e7d |
| 229 | image copy 2.png | ./upload/2025/07/14/20250714124154-d995763d.png | d995763d1e8cb0226dd884520a9f8e7d |
+-----+-------------------+-------------------------------------------------+----------------------------------+
3 rows in set (0.001 sec)
```
The 3 files are identical (same `md5sum`). We upload them in the same batch and with the "new" option "Detect and avoid duplicates during upload" deactivated.
As we can see, photo#229 and photo#230 end up with the exact same `path` because they're uploade in the same second and share the same `md5sum`. This is a real problem because if you delete photo#229 it will generate a missing file for photo#230 😥
The same problem has caused many duplicate paths with plugin Virtualize since many files share the same `date_available`. Virtualize plugin has been fixed, see https://github.com/plegall/Piwigo-virtualize/commit/19276436445096ecd0a72e8516d59c33e0579a94
- to avoid generating duplicate paths, we should introduce more randomness in the file path before writing file during upload
- to fix the existing duplicate paths, plugin Check Uploads will get a "deduplicate" action
- to avoid generating missing files, we should add a check during deletion : if the path is shared with another image, we should not delete the file
<!-- github-sync-id:3228364798 -->
to avoid generating missing files, we should add a check during deletion : if the path is shared with another image, we should not delete the file
After second thought, I won't implement this. Instead I implemented a big warning when Piwigo finds duplicate paths.
> to avoid generating missing files, we should add a check during deletion : if the path is shared with another image, we should not delete the file
After second thought, I won't implement this. Instead I implemented a big warning when Piwigo finds duplicate paths.
<img width="798" height="542" alt="Image" src="https://github.com/user-attachments/assets/9b2d809c-8b7c-436e-bfd6-3e8f0b63960b" />
<!-- github-comment-id:3114694418 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This is what I call the "duplicate path" issue: 2+ lines share the same
images.pathvalue.The 3 files are identical (same
md5sum). We upload them in the same batch and with the "new" option "Detect and avoid duplicates during upload" deactivated.As we can see, photo#229 and photo#230 end up with the exact same
pathbecause they're uploade in the same second and share the samemd5sum. This is a real problem because if you delete photo#229 it will generate a missing file for photo#230 😥The same problem has caused many duplicate paths with plugin Virtualize since many files share the same
date_available. Virtualize plugin has been fixed, see https://github.com/plegall/Piwigo-virtualize/commit/19276436445096ecd0a72e8516d59c33e0579a94After second thought, I won't implement this. Instead I implemented a big warning when Piwigo finds duplicate paths.