]> git.mjollnir.org Git - s9y.git/commitdiff
Fix imagepng() for PHP 5.1.x
authorgarvinhicking <garvinhicking>
Wed, 29 Mar 2006 13:31:02 +0000 (13:31 +0000)
committergarvinhicking <garvinhicking>
Wed, 29 Mar 2006 13:31:02 +0000 (13:31 +0000)
docs/NEWS
include/functions_images.inc.php

index a27a6dc3d33460823d18b420093eb8a03a4215c8..e359b9b30d002967da31a33763ec92b12967e816 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -1,12 +1,18 @@
 # $Id$
 
-Version 1.0-beta2 (March 13th, 2006)
+Version 1.0 ()
 ------------------------------------------------------------------------
 
+   * Fix imagepng() function call for PHP 5.1.0 versions
+     (Sebastian Mordziol)
+
    * Fix WYSIWYG javascript referencing so that plugins can access their
      objects (like emoticonchooser). Also replace <i> with <em> and
      <b> with <strong>. (Jay Bertrandt)
 
+Version 1.0-beta2 (March 13th, 2006)
+------------------------------------------------------------------------
+
    * Fixed chief-editor not being able to create editors (garvinhicking)
 
    * Added turkish language by Ahmet Usal
index 7ee1177289be9344ba963f01b1d19f79520a7bb1..3aa5bd55c6f10d0497a3873484d3e76c2ca92876 100644 (file)
@@ -903,6 +903,7 @@ function serendipity_functions_gd($infilename) {
     case 'gif':
         $func['load'] = 'imagecreatefromgif';
         $func['save'] = 'imagegif';
+        $func['qual'] = 100;
         break;
 
     case 'jpeg':
@@ -910,11 +911,13 @@ function serendipity_functions_gd($infilename) {
     case 'jfif':
         $func['load'] = 'imagecreatefromjpeg';
         $func['save'] = 'imagejpeg';
+        $func['qual'] = 100;
         break;
 
     case 'png':
         $func['load'] = 'imagecreatefrompng';
         $func['save'] = 'imagepng';
+        $func['qual'] = 9;
         break;
 
     default:
@@ -957,7 +960,7 @@ function serendipity_rotate_image_gd($infilename, $outfilename, $degrees)
     $in        = $func['load']($infilename);
 
     $out       = imagerotate($in, $degrees, 0);
-    $func['save']($out, $outfilename);
+    $func['save']($out, $outfilename, $func['qual']);
 
     $newwidth  = imagesx($out);
     $newheight = imagesy($out);
@@ -1005,7 +1008,7 @@ function serendipity_resize_image_gd($infilename, $outfilename, $newwidth, $newh
     }
 
     imagecopyresampled($out, $in, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
-    $func['save']($out, $outfilename, 100);
+    $func['save']($out, $outfilename, $func['qual']);
     $out = null;
     $in  = null;