0

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!

Gordon
  • 312,688
  • 75
  • 539
  • 559
David
  • 646
  • 1
  • 7
  • 27
  • I would of though instantiating that object (`ezcImageSaveOptions`) on its own would not affect the `transform()` method being called above. – alex Jan 08 '11 at 15:06

1 Answers1

1

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?

tobyS
  • 860
  • 1
  • 7
  • 15