|
@ -459,7 +459,6 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create image object |
|
|
// create image object |
|
|
$image = new Image($post['file'], $post['extension']); |
|
|
$image = new Image($post['file'], $post['extension']); |
|
|
|
|
|
|
|
@ -471,23 +470,29 @@ |
|
|
$post['width'] = $image->size->width; |
|
|
$post['width'] = $image->size->width; |
|
|
$post['height'] = $image->size->height; |
|
|
$post['height'] = $image->size->height; |
|
|
|
|
|
|
|
|
if($config['minimum_copy_resize'] && |
|
|
if($config['spoiler_images'] && isset($_POST['spoiler'])) { |
|
|
|
|
|
$post['thumb'] = 'spoiler'; |
|
|
|
|
|
|
|
|
|
|
|
$size = @getimagesize($config['spoiler_image']); |
|
|
|
|
|
$post['thumbwidth'] = $size[0]; |
|
|
|
|
|
$post['thumbheight'] = $size[1]; |
|
|
|
|
|
} elseif($config['minimum_copy_resize'] && |
|
|
$image->size->width <= $config['thumb_width'] && |
|
|
$image->size->width <= $config['thumb_width'] && |
|
|
$image->size->height <= $config['thumb_height'] && |
|
|
$image->size->height <= $config['thumb_height'] && |
|
|
$post['extension'] == ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'])) { |
|
|
$post['extension'] == ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'])) { |
|
|
|
|
|
|
|
|
// Copy, because there's nothing to resize |
|
|
// Copy, because there's nothing to resize |
|
|
copy($post['file'], $post['thumb']); |
|
|
copy($post['file'], $post['thumb']); |
|
|
|
|
|
|
|
|
$post['thumbwidth'] = $image->size->width; |
|
|
$post['thumbwidth'] = $image->size->width; |
|
|
$post['thumbheight'] = $image->size->height; |
|
|
$post['thumbheight'] = $image->size->height; |
|
|
} else { |
|
|
} else { |
|
|
$thumb = $image->resize($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'], $config['thumb_width'], $config['thumb_height']); |
|
|
$thumb = $image->resize($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'], $config['thumb_width'], $config['thumb_height']); |
|
|
$thumb->to($post['thumb']); |
|
|
$thumb->to($post['thumb']); |
|
|
|
|
|
|
|
|
$post['thumbwidth'] = $thumb->width; |
|
|
$post['thumbwidth'] = $thumb->width; |
|
|
$post['thumbheight'] = $thumb->height; |
|
|
$post['thumbheight'] = $thumb->height; |
|
|
|
|
|
|
|
|
$thumb->_destroy(); |
|
|
$thumb->_destroy(); |
|
|
} |
|
|
} |
|
|
$image->destroy(); |
|
|
$image->destroy(); |
|
@ -531,7 +536,7 @@ |
|
|
// Remove DIR_* before inserting them into the database. |
|
|
// Remove DIR_* before inserting them into the database. |
|
|
if($post['has_file']) { |
|
|
if($post['has_file']) { |
|
|
$post['file'] = substr_replace($post['file'], '', 0, strlen($board['dir'] . $config['dir']['img'])); |
|
|
$post['file'] = substr_replace($post['file'], '', 0, strlen($board['dir'] . $config['dir']['img'])); |
|
|
if($is_an_image) |
|
|
if($is_an_image && $post['thumb'] != 'spoiler') |
|
|
$post['thumb'] = substr_replace($post['thumb'], '', 0, strlen($board['dir'] . $config['dir']['thumb'])); |
|
|
$post['thumb'] = substr_replace($post['thumb'], '', 0, strlen($board['dir'] . $config['dir']['thumb'])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|