Wondering if there is a way to get some stats / reports out of the photos database? specifically, I want to inspect photos taken with a particular zoom lens, and find the occurrence count at the different focal lengths.
You can open the databases in pretty much any SQL database manager, it’s just a SQLite database. I’m using dbeaver on my computer.
The library.db database is probably what you’re mostly concerned with.
The lens table has all the lenses you’ve used and their ID. You can join this to the images table on the lens_id column.
select l.name, i.focal_length, count(*) from images i
left join lens l on l.id = i.lens_id
group by i.focal_length, l.name
order by l.name, i.focal_length
Go to the collections module and select lens to filter by then select the specific lens. Add a rule to narrow down the images and filter on focal length.
This is what @wpferguson is talking about:
I have created a lua script module that takes the criteria that is used to create the current view “collections” module (no matter what it is—not just the lens and focal length) and create a csv file from it.
So the csv file contents from the above filtering looks like this (opened in LibreOffice Calc spreadsheet):
If you (or anyone else for that matter) are interested in the script, let me know.


