]> git.mjollnir.org Git - s9y.git/commitdiff
Fix PDF thumbnail creation.
authorgarvinhicking <garvinhicking>
Fri, 13 May 2005 12:30:55 +0000 (12:30 +0000)
committergarvinhicking <garvinhicking>
Fri, 13 May 2005 12:30:55 +0000 (12:30 +0000)
docs/NEWS
include/functions_images.inc.php

index 339c332bb38786a608813c22be2d80a50a457802..21dce1351af5f556efe6821d53ca554245b3e826 100644 (file)
--- 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
index d8ca99a58eb2840aef3649b22183fedc5b25704f..0b7d7623bd2743bd520106c6af62eb5321266b85 100644 (file)
@@ -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 '<div class="serendipityAdminMsgError">'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'</div>';
                 $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;