' . $element['alt'] . ' '; return $template; } static function adjustImageDimensions($element, $column_count) { $column_width = ColumnsHelper::columnWidth($column_count); $padded_width = StylesHelper::$padding_width * 2; // scale image to fit column width if($element['width'] > $column_width || ($element['width'] < $column_width && $element['fullWidth'] === true) ) { $ratio = $element['width'] / $column_width; $element['width'] = $column_width; $element['height'] = ceil($element['height'] / $ratio); } // resize image if the image is padded and wider than column width if($element['fullWidth'] === false && $element['width'] >= $column_width) { $ratio = $element['width'] / ($element['width'] - $padded_width); $element['width'] = $element['width'] - $padded_width; $element['height'] = ceil($element['height'] / $ratio); } return $element; } }