aboutsummaryrefslogtreecommitdiffstats
path: root/admin/batch_manager.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-01-06 18:09:37 +0000
committermistic100 <mistic@piwigo.org>2013-01-06 18:09:37 +0000
commit4813bb8443817658bed19f76c56184cc2d150b62 (patch)
tree4ca05bcb989a40f10f5d7361511f1487e7fdbfb3 /admin/batch_manager.php
parentdd3899eab17a1f22681c21875353f15ff7f5e52d (diff)
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
Diffstat (limited to '')
-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);