I haven't been able to find the mistake yet. Because of the on-the-fly, the problem has become more complex. It was deleted from 25.000 records in the images table in about 15.000 and recreated with the on-the-fly. The deletion took place within 24 hours. Only the images table was affected. I found no changes in the code. The access_log shows no abnormalities. The IPs of the SFTP and SSH logins are all assigned to me. There is nothing to find that could explain the automatic deletion. There is only one thing left, why I ask here:
zen-photo 1.5.0
```/zp-core/class-gallery.php```
```// Check for the existence albums
/* delete the dead albums from the DB */```
```$sql2 = "DELETE FROM " . prefix('images') . " WHERE `albumid` IN $criteria";```
```/* Delete all image entries that don't belong to an album at all. */
/* delete dead images from the DB */```
```$sql = "DELETE FROM " . prefix('images') . " WHERE `albumid`='" . $firstrow . "'";```
```// Then go into existing albums recursively to clean them... very invasive.```
Does this mean, or is it possible that images are deleted by the on-the-fly whose album, i.e. their directory, is not accessible? So if the directory on the server is unreachable, why should it be?
At how many codepoints is this garbageCollect() defined and used? I have found this:
```
./zenphoto-fresh/zp-core/admin-refresh-metadata.php: $imageid = $_zp_gallery->garbageCollect(true, true, $imageid);
./zenphoto-fresh/zp-core/admin.php: $_zp_gallery->garbageCollect();
./zenphoto-fresh/zp-core/class-album.php: function garbageCollect($deep = false) {
./zenphoto-fresh/zp-core/class-album.php: function garbageCollect($deep = false) {
./zenphoto-fresh/zp-core/class-album.php: $subalbum->garbageCollect($deep);
./zenphoto-fresh/zp-core/class-gallery.php: function garbageCollect($cascade = true, $complete = false, $restart = '') {
./zenphoto-fresh/zp-core/class-gallery.php: $album->garbageCollect(true);
./zenphoto-fresh/zp-core/setup/setup-option-defaults.php:$_zp_gallery->garbageCollect();
./zenphoto-fresh/zp-core/utilities/gallery_statistics.php:$_zp_gallery->garbageCollect();
./zenphoto-fresh/zp-core/zp-extensions/seo_cleanup.php: $_zp_gallery->garbageCollect();
```