static web gallery generator

Hi guys,

A few days ago I started working on a new project. It’s supposed to be a “sophisticated” static web gallery generator eventually. I think so far one part of the main skeleton is finished, so everything looks very very “primitive” and simple.

The “sophistication” about it right now: the Python script extracts with the help of exiftool metadata from the photos and displays the info automatically on the web site. So far, it extracts the keywords from the photos and creates a tag cloud of them, which you can see on the landing page. If you click on a tag, you see the thumbnails of the photos that contain that keyword/tag as metadata. Click on a thumbnail to see the big photo, under the photo you can see a caption which is also automatically created from the extracted metadata, it’s composed of the name of the city, the name of the state and the capture date (datetimeoriginal).

Of course, my plans are much much bigger: the whole project was inspired by the Wordpress plugin Media Library Assistant and it’s metadata mapping capabilities - but I wanted this as a static web site. Here is an example of a gallery web site that uses Worpress/Media Library Assistant:

https://gallery.simon-a.info/

For all of this to work properly, of course the first step is to get the right metadata into your pictures, which you can do with Digikam, more precisely it’s tools GPS correlator and reverse geocoding - the latter creates actual location names from gps coordinates and saves them as metadata inside the photo.

Here are the links to the github repo and a demo web site.

What do you think?

I am grateful for all feedback and maybe even contributions/ideas but the quality of the code is probably not very good…

Anna

9 Likes

The site takes a while to fully load. As for the Tag Cloud:

image

1 Like

I know. Will be fixed evetually.

1 Like

Cool project Anna! I’ve been hacking Hugo to do something similar.

I always question why metadata such as exact location or shutter time would be interesting to a visitor of a portfolio style site. The only time I’m interested camera/lens metadata is when I’m looking for sample images for a certain lens at a certain aperture.

What would be useful (to me) though is adding captions in the image metadata that can be picked up by the script. That’d mean one wouldn’t have to write any (single) image specific metadata into frontmatter or markdown. Instead, it could be picked up from the image file.

2 Likes

I generate captions using metadata title, which I set in darktable before exporting

Sounds excellent. What CMS or SSG do you use?

I don’t use any off-the-shelf solution. I’ve written my own in React with an Express backend.

1 Like

It is planned that the user can choose which metadata tag/field should be displayed in a specific area of the website. But I guess they way there is still long, unless someone decides to contribute.

I am not sure I completely understand what you mean but I think Digikam has some tool to do that, maybe the metadata templates.

I meant that it’s good if the SSG can read caption metadata from the image file. :slight_smile:

1 Like

Does this project need a licence on github? I mean it‘s still very primitive… and if yes, which one?

Yes. At a minimum there should be a LICENCE file or source file headers with licence/copyright information. GitHub doesn’t care, I think, but the way intellectual property/copyright works is that if you don’t explicitly allow certain usages, they are forbidden. So if there’s no licence, no one can use the code.

(A)GPL or MIT, depending on how you feel.

1 Like

Thanks.

1 Like

Cool initiative! I’ve been working a personal site myself although the gallery is not as generic(as in adaptability) as this one. The only recommendation I have is that you should run Magick to create lower resolution copies for the img tag.

This will improve load speed and bandwidth usage: Using responsive images in HTML - HTML | MDN

1 Like

It is already using imagemagick for creating the thumbnails, i am not sure if that is what you mean with magick.
But I was thinking maybe vips/libvips would be better because it is newer and debian trixie already has it im the repo. Crucial Feature for me is that the icc profiles in the images are preserved, since I want p3 and adobergb pics to be displayed correctly. And at least gd does not do that.

Thanks for your hint about responsive image sizes.

1 Like

Yes, I meant imagemagick but of course it was just a suggestion, you can use any tool that does the job.