Author: Derick Rethans
Date: 2006-01-13 16:01:13 +0100 (Fri, 13 Jan 2006)
New Revision: 1835
Log:
- Fixed proc_open() stuff.
Modified:
packages/ImageConversion/trunk/src/handlers/imagemagick.php
packages/ImageConversion/trunk/tests/handlershell_test.php
Modified: packages/ImageConversion/trunk/src/handlers/imagemagick.php
===================================================================
--- packages/ImageConversion/trunk/src/handlers/imagemagick.php 2006-01-13
14:42:50 UTC (rev 1834)
+++ packages/ImageConversion/trunk/src/handlers/imagemagick.php 2006-01-13
15:01:13 UTC (rev 1835)
@@ -255,29 +255,30 @@
array( 'pipe', 'w' ),
array( 'pipe', 'w' ),
);
-
+
// Open ImageMagick process
$imageProcess = proc_open( $this->binary, $descriptors, $pipes );
+
// Close STDIN pipe
fclose( $pipes[0] );
-
+
+ $outputString = '';
+ // Read STDOUT
+ do
+ {
+ $outputString .= rtrim( fgets( $pipes[1], 1024 ), "\n" );
+ } while ( !feof( $pipes[1] ) );
+
$errorString = '';
// Read STDERR
do
{
- $errorString .= rtrim( fgets( $pipes[2], 1024) , "\n" );
+ $errorString .= rtrim( fgets( $pipes[2], 1024 ), "\n" );
} while ( !feof( $pipes[2] ) );
- $outputString = '';
- // Read STDOUT
- do
- {
- $outputString .= rtrim( fgets( $pipes[1], 1024) , "\n" );
- } while ( !feof( $pipes[1] ) );
-
// Wait for process to terminate and store return value
$return = proc_close( $imageProcess );
-
+
// Process potential errors
if ( $return != 0 || strlen( $errorString ) > 0 || strpos(
$outputString, 'ImageMagick' ) === false )
{
Modified: packages/ImageConversion/trunk/tests/handlershell_test.php
===================================================================
--- packages/ImageConversion/trunk/tests/handlershell_test.php 2006-01-13
14:42:50 UTC (rev 1834)
+++ packages/ImageConversion/trunk/tests/handlershell_test.php 2006-01-13
15:01:13 UTC (rev 1835)
@@ -32,7 +32,6 @@
$this->basePath = dirname( __FILE__ ) . '/data/';
$this->handlerClass = 'ezcImageImagemagickHandler';
$this->handler = new $this->handlerClass( call_user_func( array(
$this->handlerClass, 'defaultSettings' ) ) );
- // parent::setUp();
}
public function testLoadSuccess()
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components