aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_ranks.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2011-04-30 19:41:09 +0000
committerpatdenice <patdenice@piwigo.org>2011-04-30 19:41:09 +0000
commit706c6bea3e3a950e5e9cead7f21d4a02929ea2df (patch)
tree0ffa0c0fe1181c3077fa7f52492485485d2170f7 /admin/element_set_ranks.php
parent65b29f2b18ebcd2cfd43d70e45842e16ae85b555 (diff)
Division by zero corrected on element_set_ranks.php if no thumbnails to display.
git-svn-id: http://piwigo.org/svn/branches/2.2@10711 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/element_set_ranks.php')
-rw-r--r--admin/element_set_ranks.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/admin/element_set_ranks.php b/admin/element_set_ranks.php
index da2ace70e..a01c568f0 100644
--- a/admin/element_set_ranks.php
+++ b/admin/element_set_ranks.php
@@ -245,7 +245,10 @@ while ($row = pwg_db_fetch_assoc($result))
}
$current_rank++;
}
-$clipping=array_sum($clipping)/count($clipping);
+if (count($clipping) > 0)
+{
+ $clipping=array_sum($clipping)/count($clipping);
+}
foreach ($thumbnail_info as $thumbnails_info)
{
$thumbnail_x_center = $thumbnails_info['width']/2;