#######################################
2017년 1월 9일, 그누보드5 5.2.5 패치 내용에 해당 팁 내용이 포함 되었습니다.
http://sir.kr/g5_pds/3586
기존에 있던 팁 첨부파일은 패치 내용에 중복되므로 삭제하겠습니다.
#######################################
그누보드5에 적용된 스마트에디터2 이미지 업로드시
현재는 원본 파일이 그대로 서버에 저장되고 있습니다.
그래서 원본 파일( JPG, PNG 파일만 )을 썸네일로 바꿔서 올릴 수 있도록 조금 더 코드를 덧붙여 놓았습니다.
적용법은
첨부파일을 복사해서 그누보드5 경로에 붙여넣기 하면 됩니다.
설정하는 방법은
extend/smarteditor_upload_extend.php
파일을 보시면 주석을 달아 놓았습니다. 위의 파일에서 원하는 수치만 바꿔서 적용하면 됩니다.
만약에 문제가 있다면
위에 언급한 extend/smarteditor_upload_extend.php 파일에서
define('SMARTEDITOR_UPLOAD_RESIZE', 0); 사용안함으로 바꿔주세요.
에러가 날수 있는 부분 :
매우 큰 이미지 파일을 썸네일 할시, php 허용 메모리가 작다면 에러가 일어날 수 있습니다.
1
2017년 1월 9일, 그누보드5 5.2.5 패치 내용에 해당 팁 내용이 포함 되었습니다.
http://sir.kr/g5_pds/3586
기존에 있던 팁 첨부파일은 패치 내용에 중복되므로 삭제하겠습니다.
#######################################
그누보드5에 적용된 스마트에디터2 이미지 업로드시
현재는 원본 파일이 그대로 서버에 저장되고 있습니다.
그래서 원본 파일( JPG, PNG 파일만 )을 썸네일로 바꿔서 올릴 수 있도록 조금 더 코드를 덧붙여 놓았습니다.
적용법은
첨부파일을 복사해서 그누보드5 경로에 붙여넣기 하면 됩니다.
설정하는 방법은
extend/smarteditor_upload_extend.php
파일을 보시면 주석을 달아 놓았습니다. 위의 파일에서 원하는 수치만 바꿔서 적용하면 됩니다.
만약에 문제가 있다면
위에 언급한 extend/smarteditor_upload_extend.php 파일에서
define('SMARTEDITOR_UPLOAD_RESIZE', 0); 사용안함으로 바꿔주세요.
에러가 날수 있는 부분 :
매우 큰 이미지 파일을 썸네일 할시, php 허용 메모리가 작다면 에러가 일어날 수 있습니다.
1
댓글 19개
[code]
if ($this->is_valid_image_file($file_path)) {
try {
ExceptionThrower::Start(); // 위치 변경
$this->handle_image_file($file_path, $file);
if( $this->options['is_resize'] ){
$resize_options = array(
'max_width'=>$this->options['resize_max_width'],
'max_height'=>$this->options['resize_max_height'],
'jpeg_quality'=>$this->options['resize_jpeg_compress'],
'auto_orient' => true,
);
if ($this->create_scaled_image($file->name, '', $resize_options)) {
$file->size = $this->get_file_size($file_path, true);
}
}
$image_width_height = $this->get_image_size($file_path);
$file->width = $image_width_height[0];
$file->height = $image_width_height[1];
// $file->image_type = $image_width_height[2]; // 삭제
ExceptionThrower::Stop(); // 위치 변경
} catch (Exception $ex) {
unlink($file_path);
$file->error = $this->get_error_message('accept_file_types');
}
} else { //로빈아빠님이 알려주심, 이미지 업로드 체크
[/code]
저 역시 김무식2님 처럼 이미지 업로드나 파일 매치가 안 됐는데,
UploadHandler.php 1159라인 근처에서
ExceptionThrower::Start();
ExceptionThrower::Stop();
위치를 변경하고,
$file->image_type = $image_width_height[2]; 를 삭제하니깐 잘 작동합니다.
좋은 소스 고맙습니다.
if ($this->is_valid_image_file($file_path)) {
try {
ExceptionThrower::Start(); // 위치 변경
$this->handle_image_file($file_path, $file);
if( $this->options['is_resize'] ){
$resize_options = array(
'max_width'=>$this->options['resize_max_width'],
'max_height'=>$this->options['resize_max_height'],
'jpeg_quality'=>$this->options['resize_jpeg_compress'],
'auto_orient' => true,
);
if ($this->create_scaled_image($file->name, '', $resize_options)) {
$file->size = $this->get_file_size($file_path, true);
}
}
$image_width_height = $this->get_image_size($file_path);
$file->width = $image_width_height[0];
$file->height = $image_width_height[1];
// $file->image_type = $image_width_height[2]; // 삭제
ExceptionThrower::Stop(); // 위치 변경
} catch (Exception $ex) {
unlink($file_path);
$file->error = $this->get_error_message('accept_file_types');
}
} else { //로빈아빠님이 알려주심, 이미지 업로드 체크
[/code]
저 역시 김무식2님 처럼 이미지 업로드나 파일 매치가 안 됐는데,
UploadHandler.php 1159라인 근처에서
ExceptionThrower::Start();
ExceptionThrower::Stop();
위치를 변경하고,
$file->image_type = $image_width_height[2]; 를 삭제하니깐 잘 작동합니다.
좋은 소스 고맙습니다.
게시글 목록
| 번호 | 제목 |
|---|---|
| 24149 | |
| 24140 | |
| 24133 | |
| 24125 | |
| 24119 | |
| 24109 | |
| 24105 | |
| 24101 | |
| 24093 | |
| 24089 | |
| 24077 | |
| 24074 | |
| 24071 | |
| 24070 | |
| 24067 | |
| 24056 | |
| 24050 | |
| 24046 | |
| 24043 | |
| 24040 | |
| 24037 | |
| 24036 | |
| 24035 | |
| 24034 | |
| 24021 | |
| 24017 | |
| 24005 | |
| 24002 | |
| 23990 | |
| 23980 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기