diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 21:56:27 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 21:56:27 -0700 |
| commit | f27919aa1e5625de50e25c215b17099134a18e22 (patch) | |
| tree | 213b824115ad1dd50e75873485a6d0adbc218a0b /modules/gallery/helpers | |
| parent | 377bdf2803eb69efe0d16e4580a922f4b83cbf0b (diff) | |
| parent | 826e104fa98eca33afd8cb59ebf8123021145609 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers')
| -rw-r--r-- | modules/gallery/helpers/photo.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 5cf37de1..96a66d29 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -109,8 +109,12 @@ class photo_Core { // there's only one save() happening here. module::event("item_created", $photo); - // Build our thumbnail/resizes - graphics::generate($photo); + // Build our thumbnail/resizes. If we fail to build thumbnail/resize we assume that the image + // is bad in some way and discard it. + if (!graphics::generate($photo)) { + $photo->delete(); + throw new Exception("@todo BAD_IMAGE_FILE"); + } // If the parent has no cover item, make this it. if (access::can("edit", $parent) && $parent->album_cover_item_id == null) { |
