Hi. This is my first post here. Hope you can help me
I'm working with ezPublish 4.0. I'm developing an extension and I want to
use eZcImageConversion for my purpouses.
I'm trying to convert a psd file to jpeg preview. So, I've coded something
like. $settings = new ezcImageConverterSettings(
array( new ezcImageHandlerSettings( 'ImageMagick',
'ezcImageImagemagickHandler' ) )
);
$converter = new ezcImageConverter( $settings );
$filters = array(
new ezcImageFilter(
'filledThumbnail',
array(
'width' => 119,
'height' => 122,
'color' => array(255, 255, 255)
)
)
);
$converter->createTransformation( 'thumb', $filters, array( 'image/jpeg'
) );
try
{
$converter->transform( 'thumb', $src, $destination);
}
catch ( ezcImageTransformationException $e)
{
die( "Error transforming the image: <{$e->getMessage()}>" );
}
But i'm gettin an error. Here is the message
Fatal error: Uncaught exception 'Exception' with message 'The command
'convert
'var/ezflow_site/storage/original/application/adapted/mini/..11152cf535d9b89
b1c13647674bf2aa0.jpgizjqM6GVnHDZ' -resize '119x122' -crop '119x122+0-14!'
-background '#ffffff' -flatten
'JPG:var/ezflow_site/storage/original/application/adapted/mini/..11152cf535d
9b89b1c13647674bf2aa0.jpgizjqM6GVnHDZ'' resulted in an error: ''.'
Exception is thrown in this part of imagemagick_base.php file
// Open ImageMagick process
$imageProcess = proc_open( $command, $descriptors, $pipes );
// Close STDIN pipe
fclose( $pipes[0] );
$errorString = '';
// Read STDERR
do
{
$errorString .= rtrim( fgets( $pipes[2], 1024) , "\n" );
} while ( !feof( $pipes[2] ) );
// Wait for process to terminate and store return value
// print_r(proc_get_status($imageProcess));
$return = proc_close( $imageProcess );
// Process potential errors
if ( $return != 0 || strlen( $errorString ) > 0 )
{
// If this code is reached we have a bug in this component or in
ImageMagick itself.
throw new Exception( "The command '{$command}' resulted in an
error: '{$errorString}'." );
}
$return value is always "1" (not -1). This thing doesn't happen when I use
another filter like scale.
I have read about proc_close and it seems that this command return "-1" if
php is compiled with enable-signchild, but I'm getting "1" and not "-1".
I'm working at ubuntu with php 5.2.4 installed.
Last, I have to say that if I comment the if part of the code above,
thumbnail is generated as expected, but I wouldn't like to hack this code.
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components