Browse Source

Merge b95f745c77 into 8211c01d84

pull/107/merge
Kashire GitHub 7 years ago
parent
commit
4398212059
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      post.php

+ 18
- 0
post.php View File

@@ -1028,6 +1028,24 @@ if (isset($_POST['delete'])) {
$file['width'] = $size[0];
$file['height'] = $size[1];
}
else if ($file['extension'] == "txt" && $config['txt_file_thumbnail']){
$path = $file['thumb'];
$error = shell_exec_error( 'convert -thumbnail x300 xc:white -font "FreeMono" -pointsize 12 -fill black -annotate +15+15 ' .
escapeshellarg('@'.$file['tmp_name']) . ' ' .
escapeshellarg($file['thumb']));

if ($error){
$path = sprintf($config['file_thumb'],isset($config['file_icons'][$file['extension']]) ? $config['file_icons'][$file['extension']] : $config['file_icons']['default']);
}

$file['thumb'] = basename($file['thumb']);
$size = @getimagesize($path);
$file['thumbwidth'] = $size[0];
$file['thumbheight'] = $size[1];
$file['width'] = $size[0];
$file['height'] = $size[1];
}
else {
// not an image
//copy($config['file_thumb'], $post['thumb']);


Loading…
Cancel
Save