Announcement

#1 2016-06-30 21:58:44

jonxvel
Member
2014-03-30
47

Md5sum

Hello

I create a simple script to compare locale pictures that i need to upload with the online server by comparing md5sum, for preventing duplicates and time to upload, etc...

The problem is that in the dbase of piwigo a lot of pictures don´t have the md5sum fill. (appears Null). Why?  Is any way to recreate the md5sum in the database?

Thanks a lot,


Sistema operacional: Linux
PHP: 5.4.28 (Mostrar info) [2016-06-30 13:53:55]
MySQL: 5.5.50-cll [2016-06-30 19:53:55]
Biblioteca gráfica: External ImageMagick 6.7.2-7

Offline

 

#2 2016-07-01 11:06:23

flop25
Piwigo Team
2006-07-06
7037

Re: Md5sum

Hello
I never looked on that part of the coe, but I would say such pictures comes from an FTP sync or something like this


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

 

#3 2016-07-01 17:42:18

jonxvel
Member
2014-03-30
47

Re: Md5sum

Yes.  Most probably.  When we update a lot of pictures (one year ago), we upload in this way.
So, do you think is any way to run the php code to do this task?

Offline

 

#4 2016-07-01 18:45:14

flop25
Piwigo Team
2006-07-06
7037

Re: Md5sum

Yiu can try to virtualize them via the so called plug-in
You may try to sync metadata also


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

 

#5 2016-07-01 19:28:36

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

Re: Md5sum

That won't work. Currently the only piece of code that compute the file md5sum is in the upload system. the simplest solution would be a batch manager action.

Offline

 

#6 2016-07-01 20:11:13

jonxvel
Member
2014-03-30
47

Re: Md5sum

Thanks for your help, but how to do a " batch manager action". 
It´s any easy way?  Maybe the option to create a simple plugin for this task?

Thanks again.

Offline

 

#7 2016-07-02 14:16:56

jonxvel
Member
2014-03-30
47

Re: Md5sum

Hi, Pierrick

Do you think is possible to create a plugin for this task.  Will help a lot in my daily work.
I can pay 20-30$, and to contribute in the Piwigo Extensions to share with the community.  Is possible?

Offline

 

#8 2016-07-02 17:55:01

teekay
Member
2013-06-12
427

Re: Md5sum

Writing a script that compares files on a local filesystem with ones on a remote one sounds like reinventing the wheel. And reading the remote files' md5sum from a database seems to add some level of complexity.

Maybe I don't understand correctly what you are trying to achieve, but it sounds like you could just use "rsync". https://en.wikipedia.org/wiki/Rsync

Last edited by teekay (2016-07-02 18:05:01)

Offline

 

#9 2016-07-02 23:35:33

jonxvel
Member
2014-03-30
47

Re: Md5sum

I will explain my problem to be more clear:

Time ago, we upload thousends of photos by FTP and after change the order, create folders, delete someones, etc...

After we found a lot of pictures in several HD, but most of them were upload in the first process, but not all.  How to know wich are in the server (bluhost.com - remote server) and wich not?  The only way i found easily is to do simple script to check the md5sum locally and compare with the remote db. 

The problem is only the pictures that are upload via web has the md5 in de db.  To get the md5 of a remote file, i need to download, that is a really hard task.  So i think to code a plugin to calculate the md5 and fill the empy fields in the db. 

That´s correct?  Any other way?

Thanks for all.

Offline

 

#10 2016-07-03 09:31:15

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

Re: Md5sum

@teekay: if photos were added with FTP+sync method then yes rsync would do the job perfectly. But if you added photos with web/API upload, then you can't use rsync, since the filesystem structure is different.

A plugin makes sense and if photos added by web/API have a md5sum it makes sense that photos added by FTP+sync also have one.

@jonxvel you can take a look at [extension by mistic100] Skeleton it includes an example of batch manager prefilter/action

I'll quickly write a plugin if you don't know how to do it.

Offline

 

#11 2016-07-03 10:43:51

jonxvel
Member
2014-03-30
47

Re: Md5sum

Hi, Pierrick

Thanks for your help, but in fact, i don´t know how to use it.  I had install it, but don´t appears to much information and don´t know how to resolve the problem. 

As you said, the upload methods are really differents in differents periods, some with ftp (even today), some via API - Web, so if you can write the plugin will be great and will help me a lot to me, and hope to other users.

Thanks for all.

Offline

 

#12 2016-07-09 14:14:39

jonxvel
Member
2014-03-30
47

Re: Md5sum

Hi.

Sorry.  Any news about the md5 plugin?

Offline

 

#13 2016-07-09 20:19:11

jnashpiwigo
Piwigo Team
2014-10-21
252

Re: Md5sum

*FUTURE REQUEST*

Once we have the ability to accommodate the MD5's, could this be added to the Duplicates prefilter options in the Batch Manager to determine if there are duplicates based on MD5 of the image file?

I've written a script to do this outside of piwigo, but it would be nice to do within gallery as an admin function.

*THANKS*

Offline

 

Board footer

Powered by FluxBB

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