RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
2.17k stars 100 forks source link

database disk image is malformed #1333

Closed jdblank closed 11 months ago

jdblank commented 11 months ago

Hi thanks for a great app. I am just getting started trying my first export and get the following error:

database disk image is malformed

Attached is crash log.

Thanks,

Josh osxphotos_crash.log

RhetTbull commented 11 months ago

The error is occurring while trying to read one of the databases in your Photos library (~/Pictures/Photos Library.photoslibrary/search/psi.sqlite) which contains metadata about the photos. This file appears to be corrupt.

I would try to repair the Photos library and then try the export. This is a Photos error not one caused by osxphotos. This database is not strictly needed to do an export (it contains labels / categories assigned by Photos to the images, not information about the images that you have added) but as currently written, osxphotos cannot do the export because of the error. I'll add code to catch this and continue the export if the search database cannot be read. This is the first time in thousands of exports I've seen this.

jdblank commented 11 months ago

OK thanks. I restarted photos and now it seems to be working.

RhetTbull commented 11 months ago

Glad it's working. Let me know if you run into any other issues.