1
0

* Fix PDF imagemagick thumbnail generation to be properly displayed

(http://board.s9y.org/viewtopic.php?f=3&t=15446)
This commit is contained in:
Garvin Hicking
2009-07-10 14:18:04 +00:00
parent 3faaa663db
commit 480be20fb6
2 changed files with 14 additions and 0 deletions

View File

@ -1681,6 +1681,7 @@ function serendipity_isImage(&$file, $strict = false, $allowed = 'image/') {
$file['location'] = $serendipity['serendipityPath'] . preg_replace('@^(' . preg_quote($serendipity['serendipityHTTPPath']) . ')@i', '', $file['imgsrc']);
// File is PDF -> Thumb is PNG
// Detect PDF thumbs
if ($file['mime'] == 'application/pdf' && file_exists($file['location'] . '.png') && $strict == false) {
$file['imgsrc'] .= '.png';
$file['displaymime'] = 'image/png';
@ -2709,6 +2710,14 @@ function serendipity_prepareMedia(&$file, $url = '') {
}
}
// Detect PDF thumbs
if (file_exists($file['full_thumb'] . '.png')) {
$file['full_thumb'] .= '.png';
$file['full_thumbHTTP'] .= '.png';
$file['show_thumb'] .= '.png';
$sThumbSource .= '.png';
}
if (empty($file['realname'])) {
$file['realname'] = $file['name'] . '.' . $file['extension'];
}