Announcement

#1 2021-02-08 20:33:16

Ecovoy
Member
2021-02-04
18

Set image #1 of album as default album representative

Hi all,

Does anyone know of a simple way (or setting tweak) to set image #1 to be the default representative picture of the albums. Currently there only seems to be one default setting possible and that is random. Thanks!

Offline

 

#2 2021-02-08 21:02:38

jnashpiwigo
Piwigo Team
2014-10-21
250

Re: Set image #1 of album as default album representative

The easiest way I've found is through viewing the image as an admin, then selecting EDIT then PROPERTIES PAGE

Once you select this, there is an option in the form for 'Album Thumbnail' where you can type in (with auto-completion) the album(s) you want to set this photo as representative for.

Offline

 

#3 2021-02-08 21:55:39

Ecovoy
Member
2021-02-04
18

Re: Set image #1 of album as default album representative

I'm looking for a way to change the DEFAULT behavior of the application from "random" to "image #1" when it assigns an image as representative of an album. I would like to automate this process if there's a way. Thanks!

Offline

 

#4 2021-02-09 11:52:37

TOnin
Member
1970-01-01
66

Re: Set image #1 of album as default album representative

Hi,
Which sort order do you use to calculate #1 image?
set one? current one?
title, filename, date_available, date_creation, rating, visited, size...

Offline

 

#5 2021-02-09 15:55:13

Ecovoy
Member
2021-02-04
18

Re: Set image #1 of album as default album representative

I would like picture with Rank 1 to be the one assigned by default as album representative instead of random.

Offline

 

#6 2021-02-09 18:01:27

TOnin
Member
1970-01-01
66

Re: Set image #1 of album as default album representative

Ok, I understand rank is from manual order.
I'm thinking about a SQL query to copy image ids from the table where manual order is stored. If we select only those with rank=1 we can update representative_picture_id field.
Exploratory query:

Code:

SELECT c.`name`, c.`representative_picture_id`, i.`image_id`, i.`rank` FROM `pwg_categories` AS c JOIN `pwg_image_category` AS i ON i.`category_id` = c.`id` WHERE i.`rank` = 1 ;

Offline

 

#7 2021-02-10 11:04:02

TOnin
Member
1970-01-01
66

Re: Set image #1 of album as default album representative

I wonder if I can give you a SQL query to copy first rank image id in representative_picture_id. This way sounds pourly explored, pourly tested, difficult? risky?

The nice way is to post in REQUEST forum https://piwigo.org/forum/viewforum.php?id=13
This new feature will involve at least appending code in most of the files using $conf['allow_random_representative'], and function get_random_image_in_category. That's a bit of work.

@jnashpiwigo answer is good as long you don't have so many albums. Looks like if you can set manual order, you could also pick the wished representative.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact