GitHub - lutusp/photo_database_webpage_generator: A photo database searchable webpage generator · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
lutusp
photo_database_webpage_generator
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>12 Commits<br>12 Commits
LICENSE
LICENSE
README.md
README.md
database_webpage_generator.py
database_webpage_generator.py
page_template.html
page_template.html
requirements.txt
requirements.txt
View all files
Repository files navigation
Photo Database Searchable Webpage Generator
A Quick Summary: This project creates a convenient, searchable web page of a user’s image collection.
Here’s how it works:
The program recursively scans user-provided graphic image directories and collects paths to image files.
Then it creates a Sqlite3 database consisting of image filenames, sizes, creation dates, plus GPS coordinates and altitudes if that information is available in the image files.
Then it uses a small, local AI engine to create a plain-text description of each image file (details below) and saves the text descriptions in the database.
Then it creates a Web page consisting of links to all scanned images, plus the AI-generated text descriptions added as titles to each image HTML tag. The descriptions appear when the user hovers a pointing device over an image.
The user searches the Web page by way of a text entry. As the user enters a search expression, the displayed images change to match the search entry, character by character. This search feature allows the user to very quickly find specific images in large image archives.
The user has the option to create a second Web page. The first Web page, always created, works correctly while located anywhere on the host system because it uses absolute image file addressing. The second Web page, created if the user sets “relative = True”, uses relative addressing and is saved in the graphic image directory.
This second Web page has what may be a non-obvious advantage – if the user creates a USB stick for portable presentations, the relative-address Web page will work from any system the USB stick is plugged into.
Here are the project’s requirements, some of which may be changed by editing the Python source:
The Python sqlite3, gpsphoto and ollama libraries, and a few others listed in requirements.txt
Ollama installed locally
A specific, small (1.3 GB) LLM : “gemma4:e2b”, may be installed using this Ollama command:
$ ollama pull gemma4:e2b
The user may substitute another LLM of similar ability, but the LLM must be able to read and describe graphic images. Many small LLMs can provide the desired text descriptions and will run correctly on small systems.
To prepare the program for scanning and use, create a data record in the Python main() function using the instructions found there:
variable name = (task name,basepath,subdirectory, relative (True/False))
The task name can be anything the user wants -- it’s used to name the database and Web pages. This serves to distinguish tasks that span multiple image directories.
Four example data records are included to familiarize users with the data layout. Be sure to remove these examples, or simply avoid using them in the main program loop.
It’s a good idea to start with a small set of graphic images. This program can create huge databases and Web pages, but this can sometimes lead to problems. I have successfully created Web pages that provide access to over 8,000 images, but:
Such a large Web page can be difficult to use.
Only certain browsers will tolerate such large image sets, in fact, in my experience the only browser that tolerates such large image sets is Firefox. In any case it’s best to avoid huge image sets within a single Web page.
When executed, the program does the following:
It creates two subdirectories -- “databases” and “html_pages” – to receive the results.
It scans the provided image source directories, accumulating image data in a Sqlite3...