summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-04-13 04:08:59 +1000
committerSavetheinternet <savetheinternet@n0v4.com>2011-04-13 04:08:59 +1000
commit971e72000a06e5457d867861836127a4718133b0 (patch)
treee69eb633ab09d74fa593809937d19f6b7ffb9a23 /post.php
parent4c6c5b906eb04a748e3c9d4186065f9cd2307448 (diff)
Custom thubmanil image type (extension)
Diffstat (limited to 'post.php')
-rw-r--r--post.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/post.php b/post.php
index 11222d98..6833d1d6 100644
--- a/post.php
+++ b/post.php
@@ -280,7 +280,7 @@
$post['extension'] = strtolower(substr($post['filename'], strrpos($post['filename'], '.') + 1));
$post['file_id'] = time() . rand(100, 999);
$post['file'] = $board['dir'] . $config['dir']['img'] . $post['file_id'] . '.' . $post['extension'];
- $post['thumb'] = $board['dir'] . $config['dir']['thumb'] . $post['file_id'] . '.png';
+ $post['thumb'] = $board['dir'] . $config['dir']['thumb'] . $post['file_id'] . '.' . ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension']);
}
// Check string lengths
@@ -414,9 +414,7 @@
$post['filehash'] = $config['file_hash']($post['file']);
$post['filesize'] = filesize($post['file']);
-
-
- if($config['minimum_copy_resize'] && $post['width'] <= $config['thumb_width'] && $post['height'] <= $config['thumb_height']) {
+ if($config['minimum_copy_resize'] && $post['width'] <= $config['thumb_width'] && $post['height'] <= $config['thumb_height'] && $post['extension'] == ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'])) {
// Copy, because there's nothing to resize
copy($post['file'], $post['thumb']);
@@ -426,7 +424,7 @@
$image = createimage($post['extension'], $post['file']);
// Create a thumbnail
- $thumb = resize($image, $post['width'], $post['height'], $post['thumb'], $config['thumb_width'], $config['thumb_height']);
+ $thumb = resize($image, $post['width'], $post['height'], $post['thumb'], $config['thumb_width'], $config['thumb_height'], ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension']));
$post['thumbwidth'] = $thumb['width'];
$post['thumbheight'] = $thumb['height'];