diff options
| author | kaf <admin@cable6.net> | 2014-09-27 16:21:54 +0000 |
|---|---|---|
| committer | kaf <admin@cable6.net> | 2014-10-05 15:26:28 +0000 |
| commit | fe60590d192cebfdcd3f8e9cf0c687aea881577e (patch) | |
| tree | 37e9911792bf648c7c757e4a9e0cf529338f7033 /inc | |
| parent | cb7b7d070cad4286c998579d4cd263b9979535ef (diff) | |
Check spoiler_image size before ussuming it is 128×128px
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/mod/pages.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index c21086ed..36dec7bb 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1567,10 +1567,12 @@ function mod_spoiler_image($board, $post, $file) { $result = $query->fetch(PDO::FETCH_ASSOC); $files = json_decode($result['files']); + + $size_spoiler_image = @getimagesize($config['spoiler_image']); file_unlink($board . '/' . $config['dir']['thumb'] . $files[$file]->thumb); $files[$file]->thumb = 'spoiler'; - $files[$file]->thumbheight = 128; - $files[$file]->thumbwidth = 128; + $files[$file]->thumbwidth = $size_spoiler[0]; + $files[$file]->thumbheight = $size_spoiler_image[1]; // Make thumbnail spoiler $query = prepare(sprintf("UPDATE ``posts_%s`` SET `files` = :files WHERE `id` = :id", $board)); |
