David
David

Reputation: 699

How to get ez components ezcImageTransformation quality under control?

I am testing the ImageConversion component of ez components, but I just can’t get the quality of the outcoming image under control.

$converter->createTransformation( 'thumbnail', $filters, array( 'image/jpeg', 'image/png' ) );

try
{
$converter->transform(
'thumbnail',
$image,
$uploadPath.$filename.'_thumb.'.$ext
);
new ezcImageSaveOptions(array('quality' => 70));

}
catch ( ezcImageTransformationException $e)
{
die( "Error transforming the image: <{$e->getMessage()}>" );
}

If I remove the line new ezcImageSaveOptions(array('quality' => 70)); I get a “fuzzy” jpeg.

If I have it in the code, I get a 100 % quality image.

Anyone, any idea?

Thanks!

Upvotes: 0

Views: 81

Answers (1)

tobyS
tobyS

Reputation: 870

You need to submit the ezcImageSaveOptions to the createTransformation() method in order to make it work. See the documentation of createTransformation().

The 'quality' parameter should control the compression of the resulting JPEG. Did you try playing with different values here and compare the results? Which back end are you using, GD or ImageMagick?

Upvotes: 1

Related Questions