썸네일 파일 jpg로 변경
This commit is contained in:
@ -98,7 +98,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
@chmod($target_path, 0707);
|
@chmod($target_path, 0707);
|
||||||
}
|
}
|
||||||
|
|
||||||
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.png";
|
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.jpg";
|
||||||
$thumb_time = @filemtime($thumb_file);
|
$thumb_time = @filemtime($thumb_file);
|
||||||
$source_file = "$source_path/$filename";
|
$source_file = "$source_path/$filename";
|
||||||
$source_time = @filemtime($source_file);
|
$source_time = @filemtime($source_file);
|
||||||
@ -112,7 +112,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
// 이미지 파일이 없거나 아님
|
// 이미지 파일이 없거나 아님
|
||||||
if (!$size[0]) {
|
if (!$size[0]) {
|
||||||
if (!$thumb_height) $thumb_height = $thumb_width;
|
if (!$thumb_height) $thumb_height = $thumb_width;
|
||||||
$thumb_file = "$target_path/thumb-noimg_{$thumb_width}x{$thumb_height}.png";
|
$thumb_file = "$target_path/thumb-noimg_{$thumb_width}x{$thumb_height}.jpg";
|
||||||
if (!file_exists($thumb_file)) {
|
if (!file_exists($thumb_file)) {
|
||||||
$target = imagecreate($thumb_width, $thumb_height);
|
$target = imagecreate($thumb_width, $thumb_height);
|
||||||
imagecolorallocate($target, 250, 250, 250);
|
imagecolorallocate($target, 250, 250, 250);
|
||||||
@ -162,7 +162,8 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
imagepng($dst, $thumb_file, 0); // 0 (no compression) ~ 9
|
//imagepng($dst, $thumb_file, 9); // 0 (no compression) ~ 9
|
||||||
|
imagejpeg($dst, $thumb_file, 90);
|
||||||
chmod($thumb_file, 0606); // 추후 삭제를 위하여 파일모드 변경
|
chmod($thumb_file, 0606); // 추후 삭제를 위하여 파일모드 변경
|
||||||
|
|
||||||
return basename($thumb_file);
|
return basename($thumb_file);
|
||||||
|
|||||||
Reference in New Issue
Block a user