Piwigo Bugtracker

Viewing Issue Advanced Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002230 [Piwigo] photos tweak always 2011.03.25 15:25 2011.03.26 15:32
Reporter flop25 View Status public  
Assigned To flop25
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 2.2.0 Product Version 2.2.0RC4
  Target Version 2.2.0 Product Build
Summary 0002230: the thumbnails for "Manage photo ranks" are too small
Description On the pages admin.php?page=element_set_ranks&cat_id=xxx, the thumbnails are small and squared.
Steps To Reproduce
Additional Information I 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)
      )
    );
}
Tags No tags attached.
browser any
Database engine and version
PHP version
Web server Apache 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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Contact
Powered by Mantis Bugtracker