Ignore:
Timestamp:
Mar 19, 2010, 11:17:14 AM (14 years ago)
Author:
nikrou
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set_ranks.php

    r4325 r5187  
    154154{
    155155  $src = get_thumbnail_url($row);
     156
     157  list($thumbnail_width, $thumbnail_height) = getimagesize($src);
     158  $thumbnail_x_center = $thumbnail_width/2;
     159  $thumbnail_y_center = $thumbnail_height/2;
    156160 
    157161  $template->append(
     
    161165      'TN_SRC' => $src,
    162166      'RANK' => $current_rank * 10,
     167      'CLIP_TOP' => round($thumbnail_y_center - 96/2),
     168      'CLIP_RIGHT' => round($thumbnail_x_center + 96/2),
     169      'CLIP_BOTTOM' => round($thumbnail_y_center + 96/2),
     170      'CLIP_LEFT' => round($thumbnail_x_center - 96/2)
    163171      )
    164172    );
Note: See TracChangeset for help on using the changeset viewer.