Hello,
I've syncronised some albums and pictures into piwigo and endup with the message "Some checksums are missing".
If I click on it I come to the Batch Manager where I can click on "compute missing checksums". That's fine but it would be better if the checksums are caclulated during synconization. Would this possible? Have I overseen a switch?
Because the imported videos don't have "posters", I select them in batch manager and choose "Video metadata and posters". After execution I get the message:
- Metadata cannot be retrieved with MediaInfo because the XML library is missing
- Poster and thumbnail creation disabled because FFmpeg is not installed or its path is incorrect.
In my "local/config/config.inc.php" I have
$conf['show_php_errors'] = E_ALL & ~E_NOTICE & ~E_DEPRECATED; $conf['vjs_mediainfo_dir'] = '/usr/bin/'; $conf['vjs_exiftool_dir'] = '/usr/bin/'; $conf['vjs_ffprobe_dir'] = '/usr/bin/'; $conf['ffmpeg_dir'] = '/usr/bin/';
and all, mediainfo, exiftool, ffprobe as well as ffmpeg are functionable if I call them from command prompt.
Environment
Piwigo 15.5.0 Check for upgrade
Installed on 19 February 2017, 8 years 2 months 1 week 5 days ago
Operating system: Linux
PHP: 8.4.6 (Show info) [2025-05-04 07:36:28]
MySQL: 10.5.28-MariaDB-0+deb11u1 [2025-05-04 09:36:28]
Graphics Library: External ImageMagick 6.9.11-60
Cache size 22.34 Mo calculated 1 week ago Refresh
Activated plugin list8
Admin Tools
Check Uploads
Language Switch
LocalFiles Editor
OpenStreetMap
Panoramas
Take A Tour of Your Piwigo
VideoJS
Offline
astonishing :lol:
I found in gallery/_data/logs/log_2025-05-04_<...>.txt messages like
ERROR: Calling /usr/bin//usr/bin/ffmpeg did fail
exec(/usr/bin//usr/bin/mediainfo --Version 2>&1 >/dev/null) returns "sh: line 1: /usr/bin//usr/bin/mediainfo: No such file or directory", retval: 127
Changed my "local/config/config.inc.php" to:
//$conf['vjs_mediainfo_dir'] = '/usr/bin/'; //$conf['vjs_exiftool_dir'] = '/usr/bin/'; //$conf['vjs_ffprobe_dir'] = '/usr/bin/'; //$conf['ffmpeg_dir'] = '/usr/bin/';
and mediainfo as well as ffmpeg are working fine.
Still the "issue" with the missing checksums. I'd be happy if it could be calculated during syncronisation and don't require this extra step in Batch Manager.
Thanks for any hint
Last edited by AthLux (2025-05-04 10:38:38)
Offline
I'm confused ;)
because remote_sync.pl don't find ffmpeg I added again:
$conf['vjs_mediainfo_dir'] = '/usr/bin/'; $conf['vjs_exiftool_dir'] = '/usr/bin/'; $conf['vjs_ffprobe_dir'] = '/usr/bin/'; $conf['ffmpeg_dir'] = '/usr/bin/';
and both, manual syncronisation within piwigo as well as cron triggered syncronisation with remote_sync.pl is working.
Sorry for this uncertainty.
But
neither manual syncronisation nor remote_sync.pl are calculating the md5sums.
Can I configure somewhat so it will be calculated during syncronisation?
Last edited by AthLux (2025-05-04 15:33:52)
Offline
I don't think I've ever gotten a answer to that ... having checksums be automatically calculated for synchronization. They're only done automatically for uploads. I've just gotten in the habit of always going into batch manager and updating the checksums manually every now and then.
https://piwigo.org/forum/viewtopic.php? … 04#p174704
Last edited by windracer (2025-05-04 17:03:28)
Offline
Hmmm - that's not for me. I'm too lazy :)
#!/bin/bash declare ioConnect="mysql --skip-column-names -D piwigo -e" declare TopDir=/srv/piwigoStorage/matthias/www/gallery while read id path do path="${path#*.}" md5=$(md5sum "$TopDir$path" | awk '{print $1}') ext="${path##*.}" name="${path##*/}"; name=${name%.$ext*} path="${path%/*}" mv "$TopDir$path/$name.$ext" "$TopDir$path/$name-${md5:0:8}.$ext" if [ -e $TopDir/$path/pwg_representative/$name.jpg ] then mv $TopDir/$path/pwg_representative/$name.jpg $TopDir/$path/pwg_representative/$name-${md5:0:8}.jpg fi $ioConnect "UPDATE piwigo_images SET path=''.$path/$name-${md5:0:8}.$ext", md5sum='$md5' WHERE id='$id'" done <<<$($ioConnect "SELECT id, path FROM piwigo_images WHERE md5sum IS NULL")
Last edited by AthLux (2025-05-06 10:49:40)
Offline
Interesting approach. So what, you're going to schedule that to run daily or something like that?
What's the purpose of moving and renaming the files?
Offline
Currently in developing.
Because PiwigoNG isn't able to syncronise my mobile into piwigo I syncronise my mobile into cloud-service (e.g. onedrive). Already implemented:
- get new pictures from cloud service
- sort it into albums, based on geo location and count of pictues in same geo location
- import it into piwigo and caclulate md5sum
Still some tests to do and to solve the import of exif-data and thumbnails for videos.
I plan a daily execution.
Syncronise as well as remote_sync.pl import the filenames as it is on source.
If you click on "calculation of the checksums" after syncronise, the checksums will be added in this database table and the filenames will be supplemented by first 8 characters of the checksum - by the piwigo implementation.
That's simply what this script do.
I believe it wouldn't be necessary to rename the filenames. I assume all MD5 checks, done by piwigo, would use the md5sum and not the filename. Maybe piwigo add it to the filenames to enable import of several files with same filename but different md5sum.
BTW: I still have troubles with importing exif-data and thumbnails for videos. Do you too? Or that is working for you?
Last edited by AthLux (2025-05-05 06:33:30)
Offline
I've added in the script above the renaming of thumbnails in pwg_representative
Offline
I only use local sync, so Piwigo isn't renaming my files to include any MD5 hash stuff. But your approach to automatically creating the MD5 checksum and updating the DB via script is interesting, I might try that.
I am not having any issues (that I'm aware of) with EXIF data or video thumbnails.
Offline
You are right. Local Sync seems to calculate the MD5 and add the first 8 character to the filename in "path"-column. It is surprising that it don't write the MD5 into the database.
remote_sync.pl seems not to calculate MD5.
How your "local/config/config.inc.php" look like? Do you have configured the path to ffmpeg and mediainfo?
I've configured in addition:
$conf['show_php_errors']
$conf['file_ext']
$conf['upload_form_all_types']
$conf['show_exif_fields']
nothing else
Offline
Here's some snippets from my local config (I have a of other stuff in there not related to this thread). I have the ffmpeg stuff commented out and use VideoJS to generate the thumbnails. As for EXIF, I did some overrides to just show the fields I care about and then also added IPTC fields.
//$conf['ffmpeg_dir'] = '/usr/bin/ffmpeg'; //$conf['vjs_mediainfo_dir'] = '/usr/bin/mediainfo'; //$conf['vjs_exiftool_dir'] = '/usr/bin/exiftool'; //$conf['vjs_ffprobe_dir'] = '/usr/bin/ffprobe'; $conf['graphics_library'] = 'ext_imagick'; $conf['upload_form_all_types'] = true; $conf['show_exif_fields'] = array( 'Make', 'Model', 'DateTimeOriginal', ); $conf['show_iptc'] = true; $conf['show_iptc_mapping'] = array( 'iptc_caption' => '2#120', 'iptc_keywords' => '2#025', 'iptc_date_creation' => '2#055', ); $lang['iptc_caption'] = 'Description'; $lang['iptc_keywords'] = 'Keywords'; $lang['iptc_date_creation'] = 'Created Date'; $conf['use_iptc'] = true; $conf['use_iptc_mapping'] = array( 'author' => '2#080', 'name' => '2#005', 'comment' => '2#120', 'keywords' => '2#025', 'date_creation' => '2#055', );
Offline
Thanks for your config. I don't see a significant difference to mine. I really understand right? If you run remote_sync.pl the thumbnails and exif-data for videos will be imported too?
I can't imagine that it is an issue with my "local/config/config.inc.php" because MD5, thumbnails and exif-data will be imported with Batch Manager, if I don't configure the path.
I'll try to find a way to use the Batch Manager without GUI :)
Offline
I'm not using remote_sync.pl, so not sure what the differences could be.
Offline
Sorry - my missunderstanding *lol*
If you use local sync, MD5 will not be updated.
Thumbnails and Exif-Data for videos will be imported or you have to use Batch Manager for this too ?
Offline
Yeah, my process is run local sync, then go into batch manager to generate any video thumbnails, tag etc. then every now and then go into the link to update all the MD5 hashes.
Offline