From: garvinhicking Date: Fri, 13 May 2005 12:30:55 +0000 (+0000) Subject: Fix PDF thumbnail creation. X-Git-Tag: 0.9~460 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=573bbacd0723a4de9aa30f6cf9a4fc0ec38ee43a;p=s9y.git Fix PDF thumbnail creation. --- diff --git a/docs/NEWS b/docs/NEWS index 339c332..21dce13 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -6,16 +6,6 @@ Version 0.9 () * Pagination of plugins to install to save memory allocation if many plugins are downloaded (garvinhicking) - * Fix possible arbitrary media file upload for editors - (garvinhicking, sesser, nohn) - - * Fix possible XSS when using the templatedropdown or shoutbox - plugins (garvinhicking) - - * Fix pagination of "Entries by Author" (garvinhicking) - - * Fix RSS 1.0 missing top-level namespace (garvinhicking) - * Added new event hook to the trackback sending facility so that plugins like serendipity_event_trackback (additional_plugins) can send trackbacks to Blogs without RDF-metadata (garvinhicking) @@ -31,10 +21,6 @@ Version 0.9 () * Categories plugin now offers to sort by category name, description or creation date. (garvinhicking) - * Deactivated gzip compression by default, as in certain server - setups it creates problem with double-encoding or missing - ob_gzhandlers. (garvinhicking) - * Give HTML Nugget the option for a second "description" attribute that is used in the Plugin Configuration section, so that HTML nuggets with an empty title still display additional information @@ -43,8 +29,31 @@ Version 0.9 () * New entryproperties plugin option: Hide an entry from the frontpage (garvinhicking) - * Fix importers when source database is not the same as the target - database (garvinhicking) + * Media manager: Allow to upload as many files as you want via + JavaScript interaction and "add more images" button. (garvinhicking) + + * "Comments" Sidebar plugin can now have a custom title + (garvinhicking) + +Version 0.8.1 () +------------------------------------------------------------------------ + + * Fix missing PDF thumbnail creation (imagemagick only) + (garvinhicking) + + * Fix possible arbitrary media file upload for editors + (garvinhicking, sesser, nohn) + + * Fix possible XSS when using the templatedropdown or shoutbox + plugins (garvinhicking) + + * Fix pagination of "Entries by Author" (garvinhicking) + + * Fix RSS 1.0 missing top-level namespace (garvinhicking) + + * Deactivated gzip compression by default, as in certain server + setups it creates problem with double-encoding or missing + ob_gzhandlers. (garvinhicking) * Allow the serendipity_event_trackback additional trackbacks plugin to send trackbacks even if your entry did not contain at least one @@ -61,25 +70,17 @@ Version 0.9 () * Adjusted checking for "convert" binary in installation for Windows servers. Thanks to BobRock! (garvinhicking) - + * BBCode plugin: Allow =, ~ and ! URL characters (garvinhicking) - * Made serendipity_event_blogpdf an external plugin (nohn) - * Added romanian translation by Alexandru Szasz - + * Some IIS webserver compatibility for $_SERVER variables. This should ensure most basic operations. (garvinhicking) - - * Media manager: Allow to upload as many files as you want via - JavaScript interaction and "add more images" button. (garvinhicking) - + * RSS feed does no longer initialize a session and thus now causes proper cachability for Conditional Get (garvinhicking) - * "Comments" Sidebar plugin can now have a custom title - (garvinhicking) - * Fix issues on Windows installations: %T strftime-Option not known when saving a plugin and emitting timestamp (was empty), redirecting to a wrong URL for installation with '\' instead of diff --git a/include/functions_images.inc.php b/include/functions_images.inc.php index d8ca99a..0b7d762 100644 --- a/include/functions_images.inc.php +++ b/include/functions_images.inc.php @@ -312,15 +312,17 @@ function serendipity_makeThumbnail($file, $directory = '', $size = false) { } else { $r = array($size, $size); $newSize = $size . 'x' . $size; - if ($ft_mime != 'application/pdf') { - $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile); + if ($fdim['mime'] == 'application/pdf') { + $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile . '.png'); } else { - $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile .'.png'); + $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile); } exec($cmd, $output, $result); if ( $result != 0 ) { echo '
'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'
'; $r = false; // return failure + } else { + touch($outfile); } unset($output, $result); } @@ -1258,11 +1260,11 @@ function serendipity_getimagesize($file, $ft_mime = '', $suf = '') { } if ($ft_mime == 'application/pdf') { - $fdim = array(1000,1000,24, '', 'bits'=> 24, 'channels' => '3', 'mime' => 'application/pdf'); + $fdim = array(1000,1000,24, '', 'bits'=> 24, 'channels' => '3', 'mime' => 'application/pdf'); + } else { + $fdim = @getimagesize($file); } - $fdim = @getimagesize($file); - if (is_array($fdim)) { if (empty($fdim['mime'])) { $fdim['mime'] = $ft_mime;