LycheeOrg / Lychee

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
https://lycheeorg.github.io/
MIT License
3.19k stars 288 forks source link

[Enhancement] choose image as album thumbnail #442

Closed ezzra closed 2 years ago

ezzra commented 4 years ago

currently you can only change the album thumbnail image by setting the favorite star to images, but that should be independent from that. It would be necessary to create a new menu operation to change the album thumbnail, maybe even the two underlying thumbs.

ildyria commented 4 years ago

That could be an interesting optimization. But the UI design (and implementation) of it is unsure.

gardiol commented 4 years ago

I immagine it as a click you do on an image like for star, maybe in a differenc orner... You can set one or more and if you set more than one, it cycles.

d7415 commented 3 years ago

From #871 (@evoludolab):

I would like to be able to select photos that are displayed as album covers. In particular, it would be nice to set the album cover by tagging one of its photos as the cover photo through the context menu. For albums that contain sub-albums, the sub-album-covers should also be available as potential covers for the parent album. This becomes particularly important if an album includes only sub-albums and no photos.

Maybe this could be implemented by leveraging the existing tags, e.g. by introducing an AlbumCover-tag. However, tagging multiple photos in one album could be an issue as well as if the tagged photo should serve as the cover of a parent album higher up in the hierarchy. Allowing users to override the default set by the owner of the album (if any) would be nice but certainly lower priority.

Since such an enhancement would possibly require changes to the backend and database structure, I post the feature request here rather than in Lychee-front.

Thanks for an impressive (and stunning) tool!

ildyria commented 3 years ago

It would be better to actually add a column on the albums table to take care of such specification. We only need to record the ID of a single picture as the 3 others behind are somewhat hidden anyway.

ildyria commented 3 years ago

Additionally @evoludolab in the current implementation, you can chose the picture by starring it. :)

kamil4 commented 3 years ago

Starring is a very crude solution though. If more than one picture is starred, we can't pick their order. "Star just one per album" is a current workaround but it breaks down if there are subalbums with starred pictures.

I agree this needs to be stored in a new column in albums. Storing in photo wouldn't work for nested albums, and making it work for nested albums is important (otherwise the current workaround is good enough).

Depending on how foolproof we wanted to make it, the implemention could quickly become messy though. We would need to check and possibly update that column on every deletion/move/merge operation. Or we do it quick-and-dirty and make it the owner's responsibility to update the cover if the photo is no longer in the album. Same with permissions ("if the owner selected a photo that isn't public, that's their choice; assume they know what they are doing").

UI-wise, I agree with @evoludolab that it's an easy change, but only if, as @ildyria suggests, we focus just on the frontmost cover picture, not the two (not three :smiley:) behind. Otherwise it quickly becomes messy ("I want the second cover picture from this subalbum to be the third cover picture in the parent album").

ildyria commented 3 years ago

Or we do it quick-and-dirty and make it the owner's responsibility to update the cover if the photo is no longer in the album. Same with permissions ("if the owner selected a photo that isn't public, that's their choice; assume they know what they are doing").

I totally agree with that point of view. :stuck_out_tongue:

evoludolab commented 3 years ago

I would volunteer to look into implementing custom album covers following the suggestions above. However, I would not dare to make changes to the database structure - too scary with the migrations involved... So, if one of you is willing to add a cover column (or similar) to the album table, I would be interested in figuring out a good solution for custom album covers.

kamil4 commented 3 years ago

How are your JS skills? I'll offer you a deal: if you do the necessary work on the front end, I'll code the support in the backend :smiley:.

ildyria commented 3 years ago

How are your JS skills? I'll offer you a deal: if you do the necessary work on the front end, I'll code the support in the backend .

:rofl: :rofl: :rofl: :rofl: Someone clearly know where the annoying parts are.

By the way @evoludolab I highly encourage you to join us on gitter: https://gitter.im/LycheeOrg/Lobby :smiley: You can login with your github account.

evoludolab commented 3 years ago

How are your JS skills? I'll offer you a deal: if you do the necessary work on the front end, I'll code the support in the backend 😃.

@kamil4 I am no JS expert (and no fan of it) but have some more experience than with php - mostly stubborn, patient and a perfectionist 😏 Thanks for the offer, I'll start looking into extending the context menu for setting the album cover.

@ildyria Thanks for the invite, I'll join you gitter.

kamil4 commented 3 years ago

Someone clearly know where the annoying parts are.

Shhh! Don't scare him! :stuck_out_tongue_winking_eye:

I am no JS expert (and no fan of it) but have some more experience than with php

No worries. I'm no expert in either :smiley:.

I'll start looking into extending the context menu for setting the album cover.

There are actually two context menus, one for albums and one for photos. Actually, there are four, because each of them is different for multi-select, but we don't care about multi-select in this context.

In addition to the context menus you should also give a visual indication for the photo selected for the cover. I would suggest overloading the star indicator, only with a different color (red?). We already do it this way in other contexts (public I believe).

evoludolab commented 3 years ago

The enhancement turned out to be easier than I had expected - thanks to the clean code structure 😃 However, I had to make changes to both the front end and the back end simultaneously. For now I submitted a draft that is abusing the album.description to store the photoID of the cover. If you approve and add a column cover to the album table I can easily make the necessary changes. Looking forward to hear what you think 😉

ildyria commented 3 years ago

The enhancement turned out to be easier than I had expected - thanks to the clean code structure 😃

Thanks for the compliment. :+1:

However, I had to make changes to both the front end and the back end simultaneously.

That was to be expected. Without offering the possibility to change the picture, only backend would be needed but with the possibility to change the picture, this of course requires to modify the front-end.

For now I submitted a draft that is abusing the album.description to store the photoID of the cover. If you approve and add a column cover to the album table I can easily make the necessary changes. Looking forward to hear what you think 😉

I updated you code. Please check if you are satisfied with it.

nagmat84 commented 2 years ago

As I am currently closing old issues, which are either outdated, stalled or just became irrelevant, I wonder if this issue can be closed, too?

As far as I know this feature was implemented a long time ago.

@ildyria Right?

ildyria commented 2 years ago

yep.