diff --git a/sites/all/modules/img_assist/img_assist.module b/sites/all/modules/img_assist/img_assist.module index 3aa560e..15d8b19 100644 --- a/sites/all/modules/img_assist/img_assist.module +++ b/sites/all/modules/img_assist/img_assist.module @@ -1261,7 +1261,7 @@ function img_assist_render_image($attributes = array()) { // Get size. $width = $attributes['width']; $height = $attributes['height']; - if ($width && $height) { + if ($width || $height) { // Check to ensure that the dimensions don't exceed the max set in the // img_assist settings. $max_size = explode('x', variable_get('img_assist_max_size', '640x640')); @@ -1287,11 +1287,11 @@ function img_assist_render_image($attributes = array()) { // Get new width and height for this inline image. // Width is controlling factor. - if (round($width / $aspect_ratio) <= $height) { + if ((!$height && $width) || (round($width / $aspect_ratio) <= $height)) { $height = round($width / $aspect_ratio); } // Height is controlling factor. - else { + else if (!$width && $height) { $width = round($height * $aspect_ratio); }