mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
#217 썸네일 생성 방법을 문서 모듈에서 crop/ratio를 정할 수 있게 하고 xe_webzine, xe_gallery에서 방식/가로/세로크기를 지정할 수 있게 함. newest_images 위젯 역시 동일한 설정과 동작을 추가함
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2734 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e4d55fc4d1
commit
5bdad63b7f
28 changed files with 514 additions and 267 deletions
|
|
@ -182,7 +182,7 @@
|
|||
/**
|
||||
* @brief 특정 이미지 파일을 특정 위치로 옮김 (옮길때 이미지의 크기를 리사이징할 수 있음..)
|
||||
**/
|
||||
function createImageFile($source_file, $target_file, $resize_width = 0, $resize_height = 0, $target_type = '') {
|
||||
function createImageFile($source_file, $target_file, $resize_width = 0, $resize_height = 0, $target_type = '', $thumbnail_type = 'crop') {
|
||||
if(!file_exists($source_file)) return;
|
||||
if(!$resize_width) $resize_width = 100;
|
||||
if(!$resize_height) $resize_height = $resize_width;
|
||||
|
|
@ -227,8 +227,14 @@
|
|||
if($resize_height>0 && $height >= $resize_height) $height_per = $resize_height / $height;
|
||||
else $height_per = $height / $resize_height;
|
||||
|
||||
if($width_per > $height_per) $per = $height_per;
|
||||
else $per = $width_per;
|
||||
if($thumbnail_type == 'ratio') {
|
||||
if($width_per > $height_per) $per = $height_per;
|
||||
else $per = $width_per;
|
||||
} else {
|
||||
if($width_per < $height_per) $per = $height_per;
|
||||
else $per = $width_per;
|
||||
|
||||
}
|
||||
|
||||
if(!$per) $per = 1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue