diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-06-07 13:12:04 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-06-07 13:12:04 +0200 |
commit | 1cdcafc7fca95bf06d4c6512aa96ce5d26cfe424 (patch) | |
tree | 49a707e4406b15b7efff34160c930e0f8bbf6fb0 /program/lib/Roundcube/rcube_image.php | |
parent | a58c3357692749b662602ad7be9db4ecaeaaef55 (diff) |
Added more error checking in rcube_image::resize()
Diffstat (limited to 'program/lib/Roundcube/rcube_image.php')
-rw-r--r-- | program/lib/Roundcube/rcube_image.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_image.php b/program/lib/Roundcube/rcube_image.php index 735a0df01..09bb4e81b 100644 --- a/program/lib/Roundcube/rcube_image.php +++ b/program/lib/Roundcube/rcube_image.php @@ -93,6 +93,10 @@ class rcube_image $convert = $rcube->config->get('im_convert_path', false); $props = $this->props(); + if (empty($props)) { + return false; + } + if (!$filename) { $filename = $this->image_file; } @@ -148,6 +152,10 @@ class rcube_image return false; } + if ($image === false) { + return false; + } + $scale = $size / max($props['width'], $props['height']); // Imagemagick resize is implemented in shrinking mode (see -resize argument above) |