diff options
-rw-r--r-- | inc/template.php | 10 | ||||
-rw-r--r-- | lib/tpl/default/detail.php | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/inc/template.php b/inc/template.php index 20d42a7a4..8545b4313 100644 --- a/inc/template.php +++ b/inc/template.php @@ -857,7 +857,7 @@ function tpl_img_getTag($tags,$alt=''){ * * Only allowed in: detail.php */ -function tpl_img($maxwidth=900,$maxheight=700){ +function tpl_img($maxwidth=0,$maxheight=0){ global $IMG; $w = tpl_img_getTag('File.Width'); $h = tpl_img_getTag('File.Height'); @@ -865,15 +865,15 @@ function tpl_img($maxwidth=900,$maxheight=700){ //resize to given max values $ratio = 1; if($w >= $h){ - if($w >= $maxwidth){ + if($maxwidth && $w >= $maxwidth){ $ratio = $maxwidth/$w; - }elseif($h > $maxheight){ + }elseif($maxheight && $h > $maxheight){ $ratio = $maxheight/$h; } }else{ - if($h >= $maxheight){ + if($maxheight && $h >= $maxheight){ $ratio = $maxheight/$h; - }elseif($w > $maxwidth){ + }elseif($maxwidth && $w > $maxwidth){ $ratio = $maxwidth/$w; } } diff --git a/lib/tpl/default/detail.php b/lib/tpl/default/detail.php index 1328b7174..70865c933 100644 --- a/lib/tpl/default/detail.php +++ b/lib/tpl/default/detail.php @@ -46,7 +46,7 @@ <h1><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?></h1> <div class="img_big"> - <?php tpl_img() ?> + <?php tpl_img(900,700) ?> </div> <div class="img_detail"> |