diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-06-06 00:35:39 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-06-06 00:35:39 -0600 |
commit | 7cdcb5179f6d5414c9224fb65b7b36ab69ba52da (patch) | |
tree | ffc78236234505ca953870dc68ffb76fe0cae872 /modules/gallery/helpers/graphics.php | |
parent | c5425f42a4a13f7f585ffe45c070a865cdef6077 (diff) | |
parent | 329bd8caa126040ba7abaf28e8f76e0b6739ceff (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/graphics.php')
-rw-r--r-- | modules/gallery/helpers/graphics.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 605b9ff8..4846fa8a 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -102,11 +102,12 @@ class graphics_Core { /** * Rebuild the thumb and resize for the given item. * @param Item_Model $item + * @return true on successful generation */ static function generate($item) { if ($item->is_album()) { if (!$cover = $item->album_cover()) { - return; + return false; } $input_file = $cover->file_path(); $input_item = $cover; @@ -123,7 +124,10 @@ class graphics_Core { } if (empty($ops)) { - return; + $item->thumb_dirty = 0; + $item->resize_dirty = 0; + $item->save(); + return true; } try { @@ -166,8 +170,12 @@ class graphics_Core { // Something went wrong rebuilding the image. Leave it dirty and move on. // @todo we should handle this better. Kohana::log("error", "Caught exception rebuilding image: {$item->title}\n" . + $e->getMessage() . "\n" . $e->getTraceAsString()); + return false; } + + return true; } /** |