Announcement

#1 2021-02-19 18:54:47

Ecovoy
Member
2021-02-04
18

Make uploaded file replace identical instead of duplicate

Hi,

Is there a way to make it so that uploading a file to Piwigo that has the same name as another file already present replaces it. Current behavior is creation of a duplicate. Thanks!

Offline

 

#2 2021-02-19 19:02:51

jnashpiwigo
Piwigo Team
2014-10-21
254

Re: Make uploaded file replace identical instead of duplicate

That sounds like an accident waiting to happen.  Especially with many cameras naming conventions and personal naming conventions easily allowing for duplicate file names but completely different images.

I've been bitten badly by this 'feature' many times when copying a large group of images to a directory containing other images resulting in duplicate named items overwriting in the destination.

I believe there is a better method to accomplish your request, I just can't recall where I saw it just yet.

Offline

 

#3 2021-02-19 19:09:11

jnashpiwigo
Piwigo Team
2014-10-21
254

Re: Make uploaded file replace identical instead of duplicate

Offline

 

#4 2021-02-19 19:53:46

TOnin
Member
1970-01-01
106

Re: Make uploaded file replace identical instead of duplicate

Hi,
I wonder, jnashpiwigo, if you well understood the problem. Ecovoy, seems puzzled by the reverse phenomenon you described. He expects replacement.
Anyhow, the plugins pointed out are definitely a solution.

I see different ways to update a gallery :
- FTP to upload files in */galleries/ folder. You can see and manage the subfolder tree, and so replacements.
- HTTP to add files in an album on the website. They are dispatched in a time folder tree */upload/2021/02/19/ and renamed as follow 20210219120059-0189abef.jpg. I think this is why the default behaviour is to duplicate through http.
- smartphone application ?

PS : Actually, plugins are using  HTTP but they are managing replacement.

Last edited by TOnin (2021-02-19 21:15:24)

Offline

 

#5 2021-02-19 20:00:09

jnashpiwigo
Piwigo Team
2014-10-21
254

Re: Make uploaded file replace identical instead of duplicate

That's how I interpreted the request.  'Replacement'

The scenario presents a potential loss of an image if one inadvertently uploads a new image with the same filename.  That is a bad thing in my opinion.

The extensions listed accomplish this in a safer method.

Offline

 

#6 2021-02-19 22:22:09

TOnin
Member
1970-01-01
106

Re: Make uploaded file replace identical instead of duplicate

I'm not sure we all think about the same scenario, my mind is so used to, so focused on, FTP+sync. What is the name of a file ? the name on origin file system, the names in the database, or the name on server file sytem ?
The help tab in piwigo admin interface is explaining FTP+sync, but not at all the underlying engine managing out-of-the-box uploading/adding of pictures. This is a choice I think it is made not to puzzle too many people.
In the database, there are four fields in pwg_images table, related to our discussion: file, path, storage_category_id, name, and we have a many-to-many table that makes it possible to associate one image with several categories (kind of ubiquity).
A close question in this forum, associate, move, terminology: https://piwigo.org/forum/viewtopic.php? … 40#p179940

We mainly don't need to know that, and I bet there is now no risk to get mistaken and overwrite a file. If there is still a problem, it would be wise to open an issue, and describe how to reproduce it.

As a summary, I would say FTP+Sync can add and replace, but admin add can only add. To replace it needs one of the extensions you picked.

Well, thank you, we hold the solution to deal with replacements, and this is great !

Offline

 

#7 2021-02-22 18:11:47

Ecovoy
Member
2021-02-04
18

Re: Make uploaded file replace identical instead of duplicate

Thanks for your follow up. All things considered, because I'm dealing with so many pictures and albums that have been modified throughout the years by so many hands, the best for me would be to find a way to have Piwigo run a script from time to time (or it could be a manual command) that would MERGE all duplicate pictures. The script (admin run only) would:

1.    Find duplicates (same file name, same size ...or other editable criteria)
2.    Select the latest picture (last upload) as the one to keep
3.    Copy all tags assigned to duplicates to the one to keep
4.    Copy all albums assigned to duplicates to the one to keep
5.    Delete all duplicates.


If anyone knows of a script or extension that does just that or something similar, please let me know.
Thanks!

Offline

 

#8 2021-02-23 10:48:16

flop25
Piwigo Team
2006-07-06
7037

Re: Make uploaded file replace identical instead of duplicate

Piwigo is not exactly designed to be a organizer and editing tool such as Lightroom. It can be used to sort/order/label... but, as you see, Piwigo is more focused on displaying

Extensions cited are designed to help for occasional need. Here it seems that you need to curate and organize your content on other tools, and then you display them in Piwigo.
If you are a file based guy, you could use a duplication software then FTP+sync ; or you can use a software like Darktable and Lightroom and theirs plugins to sort and upload your content


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2021-02-23 11:33:07

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

Re: Make uploaded file replace identical instead of duplicate

flop25 wrote:

Piwigo is not exactly designed to be a organizer and editing tool such as Lightroom.

Well... Piwigo is designed to organize your photos (and other medias) but I agree, it's not designed to "edit" the media.

I agree we should have some way to use the web upload form as a way to "update" existing content instead of only "create new" content.

Offline

 

#10 2021-02-23 20:17:08

Ecovoy
Member
2021-02-04
18

Re: Make uploaded file replace identical instead of duplicate

Thanks for your input guys. For me Piwigo is indeed an organiser and I consider tags & albums as the core components when organizing large amounts of pictures. When photo ABC is uploaded but already present in the structure, it makes more sense to me to "merge" pictures (or at the very least to replace older with newer) than it does to have 2 instances of ABC. I understand this would not be the best setup for everyone, especially multi-user organizations, but it would be for me since we're a small team and do everything from the admin account.

Ps : Actually, the very best would be to have Piwigo develop a desktop application that would allow communication between desktop and server side apps to improve and streamline the pre-upload and post-upload management. I would pay for such an app. I'm currently using Digikam in conjunction with Piwigo. It works, but it's far from ideal.

Offline

 

#11 2023-07-16 14:55:03

Ewgeniy
Member
2023-07-08
19

Re: Make uploaded file replace identical instead of duplicate

Hi. File swapping is necessary. ) I accidentally uploaded files with Adobe RGB profile, and now I need to replace these files with the same ones but with sRGB profile. I don't want to delete all the files from the album and re-upload, and re-do the titles, descriptions... If there was a "replace" button when editing a file, that would be great. )

P.S. The Photo Update plugin fits, I'll give it a try.
P.P.S. Update Album is also a good plugin, but can only replace 20 files at a time. )

Last edited by Ewgeniy (2023-07-16 15:19:47)

Offline

 

#12 2023-07-17 09:39:27

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

Re: Make uploaded file replace identical instead of duplicate

Here is what we have in preparation for a future version (don't know when it's going to be implemented)

https://sandbox.piwigo.com/_datas/4/y/1/4y1zzhnrnw/i/uploads/4/y/1/4y1zzhnrnw//2023/06/06/20230606164722-07e18f79-xx.png

https://sandbox.piwigo.com/_datas/4/y/1/4y1zzhnrnw/i/uploads/4/y/1/4y1zzhnrnw//2023/06/06/20230606164722-f5925dbd-xx.png

where "Mettre à jour les images déjà existantes dans l'album" means "Update files if already exist in this album".

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact