[eluser]Frank Rocco[/eluser]
Hello,
When I upload an image, I create a thumb and then resize the orginal.
The thumb looks ok, but th eresized image looks out of focus.
Code:
function resize_image($filename)
{
if (isset($filename) AND strlen($filename)>0)
{
$config['image_library'] = 'gd2';
$config['source_image'] = $_SERVER['DOCUMENT_ROOT'].'/img/category/'.$filename;
//$config['new_image'] = $_SERVER['DOCUMENT_ROOT'].'/img/category/$filename';
$config['maintain_ratio'] = TRUE;
$config['create_thumb'] = FALSE;
$config['width'] = 400;
$config['height'] = 400;
$config['quality'] = 100;
$this->image_lib->initialize($config);
if(!$this->image_lib->resize()){
die("Resize Failed." . $filename . ' ' . $this->image_lib->display_errors());
}
$this->image_lib->clear();
}
}