Skip to content

Commit

Permalink
Maintain image ratio by default when resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
kolber committed May 27, 2012
1 parent 8c8c45c commit 1b4a03c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/twig-extensions.inc.php
Expand Up @@ -68,7 +68,8 @@ function get($url, $current_url = '') {
#
# shortcut to generate the image resize path from a full image path
#
function resize_path($img_path, $max_width = '100', $max_height = '100', $ratio = '1:1', $quality = 100) {
function resize_path($img_path, $max_width = '100', $max_height = '100', $ratio = 0, $quality = 100) {

$root_path = preg_replace('/content\/.*/', '', $img_path);
$clean_path = preg_replace('/^(\.+\/)*content/', '', $img_path);

Expand Down

0 comments on commit 1b4a03c

Please sign in to comment.