Welcome Guest, Not a member yet? Register   Sign In
image library problem
#1

[eluser]alebenson[/eluser]
Hi there!
Im trying to do a thumbnail so first thing i did was

Code:
$this->load->library('image_lib');
$config['image_library'] = 'GD';
$config['source_image'] = $imagenTMP['full_path'];
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 30;
$config['height'] = 50;
$this->load->library('image_lib', $config);

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

and i got this error
Code:
Your server does not support the GD function required to process this type of image.
i've already try with $config['image_library'] = 'GD2' and the same thing happend

sent an email with the guys from the server, i ask what lib they have installed. There response was GD and GD2

ok, so i try with
Code:
$this->image_lib->rotate()

and i got this error
Code:
"An angle of rotation is required to rotate the image."

then i did just

Code:
$this->load->library('image_lib');        
$config['image_library'] = 'GD';
$config['rotation_angle'] = '90';
$this->load->library('image_lib', $config);
if ( ! $this->image_lib->rotate())
{
echo $this->image_lib->display_errors();
}

and i got the same error
Code:
An angle of rotation is required to rotate the image.

so the thing here is somewhere i dont know

any ideas?
#2

[eluser]Michael Wales[/eluser]
Could you post a link to a <? phpinfo(); ?>
#3

[eluser]alebenson[/eluser]
yes...

http://www.alebenson.com.ar/prueba.php
#4

[eluser]Merolen[/eluser]
Code:
Your server does not support the GD function required to process this type of image.

This is a some what cryptic error. I encountered the same error, and the problem was that the path to the image was wrong. Not easy to read that out of the error message Tongue
#5

[eluser]alebenson[/eluser]
hi!
yes i read your post... but im passing the path with the $image['full_path'] from the Upload Library, cannot be wrong.

i did it without CI and works fine, but that wasnt my idea

Code:
$file = $imagenTMP['full_path'];
header('Content-type: image/jpeg') ;
list($width, $height) = getimagesize($file);
$tn = imagecreatetruecolor(40,31) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, 40, 31, $width, $height) ;
$save = $imagenTMP['file_path'].$imagenTMP['raw_name'].'_th'.$imagenTMP['file_ext'];
imagejpeg($tn, $save, 70);
#6

[eluser]Merolen[/eluser]
I use the relative path from ./system/application/your/picfolder/pic.jpg and that works for me. /ci/system/application/your/picfolder/pic.jpg don't work for me. Is that what the full_path shows?
#7

[eluser]alebenson[/eluser]
Fullpath shows where the image was saved
/public_html/images/pic.jpg
look that im using the same $image[’full_path’] with ci and without it. but for some reason on ci is not working
#8

[eluser]agartzia[/eluser]
Don't know if I'm late but...

I was in the same situation, all you gotta do is
Code:
$config['rotation_angle'] = 90; // <<-- NOT '90', BUT 90
I think this is because the class needs the angle as an int, not as a string.

Regards




Theme © iAndrew 2016 - Forum software by © MyBB