Piwigo Bugtracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002230Piwigophotospublic2011.03.25 15:252011.03.26 15:32
Reporterflop25 
Assigned Toflop25 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version2.2.0RC4 
Target Version2.2.0Fixed in Version2.2.0 
Summary0002230: the thumbnails for "Manage photo ranks" are too small
DescriptionOn the pages admin.php?page=element_set_ranks&cat_id=xxx, the thumbnails are small and squared.
Additional InformationI suggest to calculate a average size with this code which works fine :

// template thumbnail initialization
$current_rank = 1;
$thumbnail_info=array();
$clipping=array();
while ($row = pwg_db_fetch_assoc($result))
{
  $src = get_thumbnail_url($row);
    
    $thumbnail_size = getimagesize($src);
    $thumbnail_info[] = array(
        'width' => $thumbnail_size[0],
        'height' => $thumbnail_size[1],
        'id' => $row['id'],
        'tn_src' => $src,
        'rank' => $current_rank * 10,
        );
    $clipping[]= min($thumbnail_size[0]*0.75,$thumbnail_size[1]*0.75);

  $current_rank++;
}
//print_r($thumbnail_info);
$clipping=array_sum($clipping)/count($clipping);
foreach ($thumbnail_info as $thumbnails_info)
{
  $thumbnail_x_center = $thumbnails_info['width']/2;
  $thumbnail_y_center = $thumbnails_info['height']/2;
  $template->append(
    'thumbnails',
    array(
      'ID' => $thumbnails_info['id'],
      'TN_SRC' => $thumbnails_info['tn_src'],
      'RANK' => $thumbnails_info['rank'],
      'CLIPING' => round($clipping),
      'CLIPING_li' => round($clipping+8),
      'CLIP_TOP' => round($thumbnail_y_center - $clipping/2),
      'CLIP_RIGHT' => round($thumbnail_x_center + $clipping/2),
      'CLIP_BOTTOM' => round($thumbnail_y_center + $clipping/2),
      'CLIP_LEFT' => round($thumbnail_x_center - $clipping/2)
      )
    );
}
TagsNo tags attached.
browserany
Database engine and version
PHP version
Web serverApache 1.3.x
Attached Files

- Relationships

-  Notes
(0004912)
flop25 (developer)
2011.03.25 15:28

this is also needed : in admin/themes/default/template/element_set_ranks.tpl line46
      <li class="rank-of-image" style="width:{$thumbnail.CLIPING_li}px; height:{$thumbnail.CLIPING_li}px; ">
        <div class="clipwrapper" style="width:{$thumbnail.CLIPING}px; height:{$thumbnail.CLIPING}px; ">

the code php above is in admin/element_set_ranks.php line210
(0004915)
svn (reporter)
2011.03.26 15:29

[Subversion] r9864 by flop25 on trunk

-----[Subversion commit log]----------------------------------------------------
feature:2230
the size of the squared thumbnails depend of the sizes of all the thumbnails : the clipping is an average of the clipping of each of the thumbnails

- Issue History
Date Modified Username Field Change
2011.03.25 15:25 flop25 New Issue
2011.03.25 15:25 flop25 Status new => assigned
2011.03.25 15:25 flop25 Assigned To => flop25
2011.03.25 15:25 flop25 browser => any
2011.03.25 15:25 flop25 Web server => Apache 1.3.x
2011.03.25 15:28 flop25 Note Added: 0004912
2011.03.26 15:29 svn Checkin
2011.03.26 15:29 svn Note Added: 0004915
2011.03.26 15:32 flop25 Status assigned => closed
2011.03.26 15:32 flop25 Resolution open => fixed
2011.03.26 15:32 flop25 Fixed in Version => 2.2.0


Copyright © 2000 - 2015 MantisBT Team
Contact
Powered by Mantis Bugtracker