#1 2025-07-25 15:30:58

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13961

Piwigo 15.6.0 : avoid duplicate paths

We have recently implemented a new tool to analyze the "upload" directory of all Piwigo installations hosted on Piwigo.com. We were looking for missing or unexpected files. As an interesting side-effect, we have discovered a few photos had a "duplicate path". It means 2 photos in your Piwigo interface are actually related to the very same file on the filesystem. It happens on 2 cases :

* if you have the same photo added with the same synchronization in different directories of "galleries" and then you ran Virtualize plugin before its version 15.a (february 2025)
* or if you upload twice the same small photo in the same second

We knew the problem about Virtualize, this is why we fixed it months ago by "deduplicating" files when moving to the "upload" directory. I personnaly thought the problem was limited to this specific case. The analyze of millions of files on Piwigo.com showed us the second issue occured sometimes.

Piwigo 15.6.0 will detect those duplicate paths and display a warning if you have any. Plugin Check Uploads is ready to handle this situation and will deduplicate files if you ask for it.

https://sandbox.piwigo.com/i?/uploads/4/y/1/4y1zzhnrnw//2024/07/09/20240709141133-ef87fc64-la.jpg
Background image by Atypeek Dgn on Pexels

Piwigo 15.6.0 release note

Offline

#2 2025-07-25 20:10:13

windracer
Member
St. Pete, FL
2014-12-28
603

Re: Piwigo 15.6.0 : avoid duplicate paths

Is this also in the recent 16.0.0 beta?

Offline

#3 2025-07-25 20:36:20

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13961

Re: Piwigo 15.6.0 : avoid duplicate paths

windracer wrote:

Is this also in the recent 16.0.0 beta?

The code to avoid duplicate paths is in 16b1. The warning will be in 16b2. Plugin Check Uploads is available for both 15 and 16.

Offline

#4 2025-07-26 19:43:38

banditsc
Member
2025-03-03
10

Re: Piwigo 15.6.0 : avoid duplicate paths

Is there a log for the duplicates? I got the message about duplicates and ran the plugin and it found two and fixed them. But it still says "We have found 7 duplicate paths. Details provided by plugin Check Uploads" I went back to the plugin and it says "Well done! Everything seems good :-)"

I have imported from /galleries and done the upload method for adding pictures. Maybe the cleanup tool is only looking at uploads and not in /galleries ?


Thanks

Offline

#5 2025-07-28 19:25:35

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13961

Re: Piwigo 15.6.0 : avoid duplicate paths

banditsc wrote:

I got the message about duplicates and ran the plugin and it found two and fixed them. But it still says "We have found 7 duplicate paths. Details provided by plugin Check Uploads" I went back to the plugin and it says "Well done! Everything seems good :-)"

Can you go into your database manager (PHPMyAdmin maybe) and perform the following SQL query:

Code:

select path, count(*) from piwigo_images group by path having count(*) > 1;

I also suspect something I have found on Piwigo.com accounts analysis : if you have paths :

./upload/2024/12/24/20241224154812-abcde1234.jpg
and
./upload/2024/12/24/20241224154812-abcde1234.JPG

Then the warning in Piwigo core will tell you there is a duplicate path but plugin Check Uploads will tell you everything is fine (and the plugin is right)

Offline

#6 2025-07-28 20:15:10

banditsc
Member
2025-03-03
10

Re: Piwigo 15.6.0 : avoid duplicate paths

They are in my galleries directory and not the uploads..

./galleries/2009/09errtech/DSC_0070.jpg     2
./galleries/2009/09errtech/DSC_0071.jpg     2
./galleries/2009/09errtech/DSC_0072.jpg     2
./galleries/2009/09errtech/DSC_0073.jpg     2
./galleries/2009/09errtech/DSC_0074.jpg     2
./galleries/2009/09errtech/DSC_0075.jpg     2
./galleries/2011/11mboktoberfest/DSCF0965.JPG

Offline

#7 2025-07-29 10:32:37

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13961

Re: Piwigo 15.6.0 : avoid duplicate paths

OK, so you are right. You have duplicates in the "galleries" directory. The Check Uploads plugin does not check the "galleries" directory.

If you have "./galleries/2009/09errtech/DSC_0070.jpg" it means you have run synchronization twice in parallel. I guess. Another side effect I hadn't anticipated! This filesystem check is very interesting.

We're going to think about a way to fix this problem for a next release. For now, do not delete photos concerned by duplicate paths.

Offline

#8 2025-08-25 10:57:54

gueba
Member
2021-12-31
77

Re: Piwigo 15.6.0 : avoid duplicate paths

I have the message:
We have found 1 duplicate paths. Details provided by plugin Check Uploads
in the header of the admin pages.
I performed a search - the plugin found 1 duplicate in the upload folder. I deleted it, but the message still existed.
A new search shows:
Gut gemacht! Alles scheint gut zu sein :-). (no problems!)
There are no files in the upload folder. I deactivated and removed the plugin, but the message is still there.

How can I get rid of this?

Offline

#9 2025-08-26 16:31:55

gueba
Member
2021-12-31
77

Re: Piwigo 15.6.0 : avoid duplicate paths

Got it. With Local Files Editor set

Code:

$conf['fs_quick_check_period'] = 0;

Offline

#10 2025-10-16 08:43:37

jacolinedk
Member
2023-01-04
5

Re: Piwigo 15.6.0 : avoid duplicate paths

I also have my images outside upload - like:
galleryname1
galleryname2
galleryname3
galleryname4
ect.

I sync every gallery if I have uploaded new images.
--------------

I got the error message with 3 images - but I had 14 path errors

A question - when this module fix the problem - how does it do it?
I added (sync) the 11 new images and updated those with the comments and hits

Offline

Board footer

Powered by FluxBB

github linkedin newsletter Piwigo.org © 2002-2025 · Contact