summaryrefslogtreecommitdiff
path: root/modules/exif/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-12 04:22:05 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-12 04:22:05 +0000
commitc397cc73bef3bf2a092e1f0ddf73fd415db49da3 (patch)
tree5458a18c53f7d980f7b98a81cb4683315a10af5d /modules/exif/helpers
parent8ae6a7a1448c411a9c1cd07dc3a45a6ec8924a32 (diff)
Don't divide by zero if there are no photos in the Gallery.
Diffstat (limited to 'modules/exif/helpers')
-rw-r--r--modules/exif/helpers/exif_task.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/exif/helpers/exif_task.php b/modules/exif/helpers/exif_task.php
index 3ca849f9..e5e70305 100644
--- a/modules/exif/helpers/exif_task.php
+++ b/modules/exif/helpers/exif_task.php
@@ -83,6 +83,9 @@ class exif_task_Core {
private static function _get_stats() {
$missing_exif = ORM::factory("exif_record")->where("dirty", 1)->count_all();
$total_items = ORM::factory("item")->where("type", "photo")->count_all();
+ if (!$total_items) {
+ return array(0, 0, 0);
+ }
return array($missing_exif, $total_items,
round(100 * (($total_items - $missing_exif) / $total_items)));
}