There is a shell script in the Darktable repository that will automatically purge from the database any image whose file does not exist:
https://github.com/darktable-org/darktable/blob/master/tools/purge_non_existing_images.sh -- August Schwerdfeger [email protected] On 8/28/19 12:00 AM, Greg Minshall wrote: > hi. i have discovered a situation where about 3,000 of my images have a > full path that is incorrect, presumably because of user error. my > question is how i should fix these paths. > > normally, "full path" points into > ---- > ~/Pictures/Collection/... > ---- > which is where rapid-photo-downloader leaves things. > > in these 3,000 cases, "full path" points at, e.g., > ---- > /media/minshall/Leica M/DCIM/100LEICA/... > ---- > i.e., presumably where rapid-photo-downloader *found* the image (or, > where i told darktable to find the image). these 3,000 images (as far > as i can tell) all exist in the "right place" in > ~/Pictures/Collection/.... > > i find i can just "import" the folders (or my entire > ~/Pictures/Collection) to get the actual images. > > but, then i'm left with residual images pointing to bad places. for > example, after doing the re-import, for one image i have (collecting by > filename): > ---- > ~/Pictures/Collection/2016/2016-03-26/L2001723.DNG > /media/minshall/LEICA M/DCIM/100LEICA/L2001723.DNG > /media/minshall/sdcard/DCIM/100LEICA/L2001723.DNG > ---- > i.e., three copies (*this* user, i.e., me, when he makes a user error, > does it up well :). > > so, i guess the question is, how to clean up darktable's database, i.e., > delete all entries that have a "full path" that matches some pattern (in > this case, "^/media/minshall"? (i'm happy to lose any edits in the > unlikely event i edited any of these images.) > > second, is there a way (some lua script, perhaps?) i could use to *list* > (on the terminal) all the entries that start with some pattern, so i can > (more easily) get a handle on the scope of the problem? for example, > with this, i could verify that i have local copies of all the images > before deleting (or, if i don't, scrounge through old SD cards, looking > for them). > > thanks! > > Greg > ____________________________________________________________________________ > darktable user mailing list > to unsubscribe send a mail to [email protected] > ____________________________________________________________________________ darktable user mailing list to unsubscribe send a mail to [email protected]
