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
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
Offline
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
Yiu can try to virtualize them via the so called plug-in
You may try to sync metadata also
Offline
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
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
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
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
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
@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
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
*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