summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/helpers/photo.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/helpers/photo.php b/core/helpers/photo.php
index 9e468116..c1c005f5 100644
--- a/core/helpers/photo.php
+++ b/core/helpers/photo.php
@@ -155,6 +155,10 @@ class photo_Core {
* @param string $format the output format using %d placeholders for width and height
*/
static function img_dimensions($width, $height, $max, $format="width=\"%d\" height=\"%d\"") {
+ if (!$width || !$height) {
+ return "";
+ }
+
if ($width > $height) {
$new_width = $max;
$new_height = (int)$max * ($height / $width);