mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 09:13:02 +02:00
optimization: in sessions write 1 less sql query (except during login)
bug: corrected algorithm for pretty calendar month view git-svn-id: http://piwigo.org/svn/trunk@1063 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -452,6 +452,7 @@ SELECT file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 as do
|
||||
$ratio_w = $tn_width/$cell_width;
|
||||
$ratio_h = $tn_height/$cell_height;
|
||||
|
||||
|
||||
$pos_top=$pos_left=0;
|
||||
$img_width=$img_height='';
|
||||
if ( $ratio_w>1 and $ratio_h>1)
|
||||
@@ -461,13 +462,13 @@ SELECT file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 as do
|
||||
{// thumbnail ratio compared to cell -> wide format
|
||||
$img_height = 'height="'.$cell_height.'"';
|
||||
$browser_img_width = $cell_height*$tn_width/$tn_height;
|
||||
$pos_left = ($tn_width-$browser_img_width)/2;
|
||||
$pos_left = ($browser_img_width-$cell_width)/2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$img_width = 'width="'.$cell_width.'"';
|
||||
$browser_img_height = $cell_width*$tn_height/$tn_width;
|
||||
$pos_top = ($tn_height-$browser_img_height)/2;
|
||||
$pos_top = ($browser_img_height-$cell_height)/2;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user