Welcome Guest, Not a member yet? Register   Sign In
Image manipulation class - resizing of images
#1

[eluser]ravikota[/eluser]
Hi Friends,

When we are resizing the images using image library, the color combination is getting lost. The original resolution is not maintained even though we have set highest quality as 100%.
Please Help.

And also watermark feature is not working for the images.

Thanks in Advance,
Ravi Kota
#2

[eluser]Référencement Google[/eluser]
Please provide the code you are using and also the library used (GD, GD2, ImageMagick, NetBPM ???) otherwise what do you want we tell or help you?
#3

[eluser]ravikota[/eluser]
function upload_photo()
{

$FilePath= 'FilePath';
$config['upload_path'] = './photo_uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '500';
$config['max_width'] = '1024';
$config['max_height'] = '1768';
$this->upload->initialize($config);

$fupload=$this->upload->do_upload($FilePath);
echo $this->upload->display_errors('<p>', '</p>');
$f=$this->upload->data();

if($fupload)
{
$config['image_library'] = 'GD';
$config['source_image'] ='./photo_uploads/'.$f['raw_name'].$f['file_ext'];
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = '100';
$config['height'] = '100';
$config['quality']='99';


$this->image_lib->initialize($config);
//$this->load->library('image_lib', $config);

$this->image_lib->resize();
echo $this->image_lib->display_errors();
}


The above is the function in my controller. The problem is that the image is resizing but the color is not maintained in the correct ratio. If any body have solution please let me know.
#4

[eluser]Référencement Google[/eluser]
Use: $config[’image_library’] = ‘GD2’;
Also, when you post code, please wrap it in the Code tags.
#5

[eluser]ravikota[/eluser]
hey... thanks a lot. it worked..




Theme © iAndrew 2016 - Forum software by © MyBB