Skip to content

Commit

Permalink
썸네일 center_mode 시 썸네일 height가 원본이미지가 작을때도 동작되게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Feb 24, 2020
1 parent e72b71c commit 8067a20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/thumbnail.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,11 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
if(!$thumb_height) {
$thumb_height = round(($thumb_width * $size[1]) / $size[0]);
} else {
if($size[0] < $thumb_width || $size[1] < $thumb_height)
if($crop_mode === 'center' && ($size[0] > $thumb_width || $size[1] > $thumb_height)){
$is_large = true;
} else if($size[0] < $thumb_width || $size[1] < $thumb_height) {
$is_large = false;
}
}
} else {
if($thumb_height) {
Expand Down

0 comments on commit 8067a20

Please sign in to comment.