bpatrik / pigallery2

A fast directory-first photo gallery website, with rich UI, optimized for running on low resource servers (especially on raspberry pi)
http://bpatrik.github.io/pigallery2/
MIT License
1.81k stars 207 forks source link

Set Folder Thumbnail #679

Open udomichel opened 1 year ago

udomichel commented 1 year ago

I can't find an option to use a specific picture as folder thumbnail. So is it possible to add a feature in the picture options?: Use this picture as folder thumb

bpatrik commented 1 year ago

There is no way to explicitly set the thumbnails of a gallery from the App.

You can:

  1. Go to Settings -> Preview settings -> set a search query like: gallery-cover
  2. Go to your photos in an explorer and a) add the gallery-cover to your photo OR b) rename your photo to gallery-cover.jpg

With this that photo will show up as gallery cover.

cheers

udomichel commented 1 year ago

OK, thanks. Didn't know that. Is it possilbe "folder.jpg" is also accepted? Much tools like Kodi oder Windows accept it for folder thumbnails. ... gallery-cover.jpg works, but shows as additional picture inside the folder. And if you have folders like 2023/07-Birthday you can use it for the folder 07-Birthday, but not for the root folder 2023. I think the easiest way for users would be an option to set the thumbnails. If it's too hard to implement, an option for hiding the gallery-cover.jpg or folder.jpg would be nice.

bpatrik commented 1 year ago

The idea is that he user should not manually set the directory thumbnail, but the app should find the best one based on Preview settings. That is the reason it is also not possible to manually set it. I'm sorry but I don't intend to change it.

You can set any search query that you like. The app will use that query to find a cover fo a given folder. If query would return more photos it picks the first one, based on the sorting method that you set.

I usually list all my family members, set the sorting to show the best photos. So folder cover always uses one of the best photos: kép

sugatam commented 1 year ago

What's most convenient for me is to mark my preferred cover photo with a high rating: exiftool -Rating=5 . Then the default sort by descending rating picks it as the cover photo.

udomichel commented 1 year ago

I use name to have the right order for pictures. normally images use dates for sorting purposes, so it's the same result with my names. Hmm ... I can use a preview sorting by rating (to use my best rated cover) and sort the directory with the previews by name? That would be confusing.

bpatrik commented 1 year ago

Renamed Preview to cover to reduce future confusion. Also adding some explanation text and reference to this bug.

This bug is also related to (duplicate of):

528, #533, #329, #80

bpatrik commented 1 year ago

I use name to have the right order for pictures. normally images use dates for sorting purposes, so it's the same result with my names. Hmm ... I can use a preview sorting by rating (to use my best rated cover) and sort the directory with the previews by name? That would be confusing.

I'm not sure if I understand your question.

mblythe86 commented 1 year ago

I'm struggling with this as well.

What's most convenient for me is to mark my preferred cover photo with a high rating

One thing that this approach (and really, any other approached based on "Preview Filter query") doesn't completely solve is thumbnails on nested directories. Let's say I sort my photos by date as follows:

YYYY/YYYY-MM/YYYY-MM-DD/pic.jpg

Sure, I can use some label or rating search to specifically pick the thumbnail for the YYYY-MM-DD folder, but then the thumbnails for the YYYY-MM and YYYY folders will be arbitrarily selected. Maybe I want YYYY to have a thumbnail from our professional family portraits, but I don't have a good way to guarantee that.

The idea is that he user should not manually set the directory thumbnail

I understand that works for your use case, but I think many others want to have the option to do manual selection (as shown by the 4 other duplicate bugs that you mentioned). I use digiKam to manage my photos, and one of the features there is that you can set directory thumbnails. Because of that, I'm used to manually setting thumbnails, and I've been doing it for years.

I'm currently working around this limitation of pigallery2 by adding extra complexity. I've written a script to query the digiKam database for the thumbnails that I've selected, then I update the pigallery2 database to reflect those selections. The problem with this approach is that when pigallery2 re-indexes, it often re-selects thumbnails for folders, overwriting my preferred one. Because of this, I have to run my digikam-to-pigallery2 thumbnail syncing script after every indexer run.

Since I already have a scripting solution to my problem, I'd just ask for a simple tweak. Can I have an API endpoint to do this manual thumbnail selection, instead of manually mucking around in the database itself? And/or could the directory_entity database table have another column lockedPreview that would prevent the indexing flow from choosing a different thumbnail for the directory?

bpatrik commented 1 year ago

I'm actively considering adding addon support to the app. That would a place for you to change this behavior in a more neat way.

bpatrik commented 8 months ago

server side extensions are supported now as beta. (no UI support yet)