aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/batch_manager.php18
1 files changed, 14 insertions, 4 deletions
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);