however my GD is installed and working correctly as i tested on local but when I uploaded to client server it showing error "The Image " cannot be displayed because it contains errors.
I access the image localhost/validate_image/show_image
My validate_image controller code
function show_image() {
$width = "200px";
$height = "200px";
$imageName = "HFPFinalLogoJpeg.jpg";
$dir=realpath(MERCHANT_IMAGE);
//Below constants are already included in application/config/constants.php file its here to just show you
$this->load->library('image_lib');
$this->image_lib->clear();
$config['image_library'] = 'gd2';
$config['source_image'] = $dir."/".$imageName;
$config['maintain_ratio'] = FALSE;
$config['dynamic_output'] = TRUE;
$config['width'] = $width;
$config['height'] = $height;
//print_r($config); die;
$this->image_lib->initialize($config);
echo $this->image_lib->resize();
}
My show_image view code
<?php
$image_properties = array(
'src' => base_url()."validate_image/show_image/220/280",
'alt' => "title Image",
'title' => 'title Image',
'width'=>135,
'height'=>135,
'border' => "0",
);
echo img($image_properties);
?>
My Server GD lib details are below
I tried and googled but with no solution are as follows. My PHP Version 5.4.35
Please Help me resolved this problem.