This project stores image metadata in a SQLite database. The DatabaseManager
class starts with a very small schema and expands it as more images are
processed.
The database begins with only three columns:
path– the file path of the image (primary key)File_Location_Folder– top‑level folder nameFile_Location_Session– session or sub‑folder name
New metadata columns are added as images are inserted. This keeps the initial schema simple while allowing it to grow with the data.
DatabaseManager.bulk_insert_images accepts a list of dictionaries. Before the
records are inserted, it gathers all keys from the batch and calls
add_columns_if_needed to create any missing columns. Columns for GPS or tag
fields automatically receive indexes when added. As a result, every piece of
metadata extracted from images becomes a new column the first time it appears.
Indexes are created automatically for frequently used fields:
File_Location_FolderandFile_Location_SessionCapture_Time(when that column exists)- GPS latitude, longitude and altitude columns
- Any column beginning with
Tag_
These indexes are created when the columns exist so queries remain fast even as the schema grows.
Tags defined in tags.config files are automatically converted to lower case
before they are stored in the database. This ensures that tag names are treated
consistently regardless of how they are written in the configuration files.