Feature 940 : improve ordering by rank by clip thumbnail to a square

git-svn-id: http://piwigo.org/svn/trunk@5187 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2010-03-19 10:17:14 +00:00
parent 872463cab1
commit b7fee65e8f
3 changed files with 24 additions and 5 deletions
+8
View File
@@ -153,6 +153,10 @@ $current_rank = 1;
while ($row = pwg_db_fetch_assoc($result))
{
$src = get_thumbnail_url($row);
list($thumbnail_width, $thumbnail_height) = getimagesize($src);
$thumbnail_x_center = $thumbnail_width/2;
$thumbnail_y_center = $thumbnail_height/2;
$template->append(
'thumbnails',
@@ -160,6 +164,10 @@ while ($row = pwg_db_fetch_assoc($result))
'ID' => $row['id'],
'TN_SRC' => $src,
'RANK' => $current_rank * 10,
'CLIP_TOP' => round($thumbnail_y_center - 96/2),
'CLIP_RIGHT' => round($thumbnail_x_center + 96/2),
'CLIP_BOTTOM' => round($thumbnail_y_center + 96/2),
'CLIP_LEFT' => round($thumbnail_x_center - 96/2)
)
);