[PHP-CVS] cvs: php-src /ext/gd/tests pngcomp.phpt

2005-12-09 Thread Pierre-Alain Joye
pajoye  Fri Dec  9 13:14:12 2005 EDT

  Modified files:  
/php-src/ext/gd/tests   pngcomp.phpt 
  Log:
  - MFB: test for compression mode in imagepng
  
  
http://cvs.php.net/diff.php/php-src/ext/gd/tests/pngcomp.phpt?r1=1.1r2=1.2ty=u
Index: php-src/ext/gd/tests/pngcomp.phpt
diff -u /dev/null php-src/ext/gd/tests/pngcomp.phpt:1.2
--- /dev/null   Fri Dec  9 13:14:12 2005
+++ php-src/ext/gd/tests/pngcomp.phpt   Fri Dec  9 13:14:12 2005
@@ -0,0 +1,37 @@
+--TEST--
+png compression test
+--SKIPIF--
+?php 
+   if (!extension_loaded('gd')) {
+   die(skip gd extension not available.);
+   }
+   if (!GD_BUNDLED) {
+   die(skip external GD libraries always fail);
+   }   
+   if (!function_exists(imagecreatefrompng) || 
!function_exists(imagepng)) {
+   die(skip png support unavailable);
+   }
+   if (!function_exists(imagecreatefromjpeg) || 
!function_exists(imagejpeg)) {
+   die(skip jpeg support unavailable);
+   }
+?
+--FILE--
+?php
+   $cwd = dirname(__FILE__);
+
+   echo PNG compression test: ;
+
+$im = imagecreatetruecolor(20,20);
+imagefilledrectangle($im, 5,5, 10,10, 0xff);
+imagepng($im, $cwd . '/test_pngcomp.png', 9);
+
+$im2 = imagecreatefrompng($cwd . '/test_pngcomp.png');
+$col = imagecolorat($im2, 8,8);
+if ($col == 0xff) {
+echo ok\n;
+}
+   
+   @unlink($cwd . /test_pngcomp.png);
+?
+--EXPECT--
+PNG compression test: ok

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/tests pngcomp.phpt

2005-12-09 Thread Pierre-Alain Joye
pajoye  Fri Dec  9 13:16:21 2005 EDT

  Modified files:  
/php-src/ext/gd/tests   pngcomp.phpt 
  Log:
  - no need to test if jpeg support exists
  
  
http://cvs.php.net/diff.php/php-src/ext/gd/tests/pngcomp.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/gd/tests/pngcomp.phpt
diff -u php-src/ext/gd/tests/pngcomp.phpt:1.2 
php-src/ext/gd/tests/pngcomp.phpt:1.3
--- php-src/ext/gd/tests/pngcomp.phpt:1.2   Fri Dec  9 13:14:12 2005
+++ php-src/ext/gd/tests/pngcomp.phpt   Fri Dec  9 13:16:21 2005
@@ -11,9 +11,6 @@
if (!function_exists(imagecreatefrompng) || 
!function_exists(imagepng)) {
die(skip png support unavailable);
}
-   if (!function_exists(imagecreatefromjpeg) || 
!function_exists(imagejpeg)) {
-   die(skip jpeg support unavailable);
-   }
 ?
 --FILE--
 ?php



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php