From 4813bb8443817658bed19f76c56184cc2d150b62 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sun, 6 Jan 2013 18:09:37 +0000 Subject: 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 --- admin/batch_manager.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'admin/batch_manager.php') diff --git a/admin/batch_manager.php b/admin/batch_manager.php index 4d2e64997..a5c82d061 100644 --- a/admin/batch_manager.php +++ b/admin/batch_manager.php @@ -457,13 +457,23 @@ SELECT ;'; $result = pwg_query($query); -while ($row = pwg_db_fetch_assoc($result)) +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 { - $widths[] = $row['width']; - $heights[] = $row['height']; - $ratios[] = floor($row['width'] * 100 / $row['height']) / 100; + 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); -- cgit v1.2.3