mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
feature:2718 errors when no photo on the gallery, use arbitrary values instead
git-svn-id: http://piwigo.org/svn/trunk@19920 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -457,12 +457,22 @@ SELECT
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$widths[] = $row['width'];
|
||||
$heights[] = $row['height'];
|
||||
$ratios[] = floor($row['width'] * 100 / $row['height']) / 100;
|
||||
if (!pwg_db_num_rows($result))
|
||||
{ // arbitrary values, only used when no photos on the gallery
|
||||
$widths = array(600, 1920, 3500);
|
||||
$heights = array(480, 1080, 2300);
|
||||
$ratios = array(1.25, 1.52, 1.78);
|
||||
}
|
||||
else
|
||||
{
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$widths[] = $row['width'];
|
||||
$heights[] = $row['height'];
|
||||
$ratios[] = floor($row['width'] * 100 / $row['height']) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$widths = array_unique($widths);
|
||||
sort($widths);
|
||||
|
||||
Reference in New Issue
Block a user