Image Lib - Resize failure - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Image Lib - Resize failure (/showthread.php?tid=7203) Pages:
1
2
|
Image Lib - Resize failure - El Forum - 04-01-2008 [eluser]gRoberts[/eluser] Well i thought i had fixed it. It seems that this works for the specific image i had but doesn't work for gifs. Would there be any reason why it wont work? I have attached the image that doesn't work using GD2 and CI's image lib. Code: public function generate($source, $output, $width, $height) { Image Lib - Resize failure - El Forum - 04-02-2008 [eluser]blender[/eluser] [quote author="gRoberts" date="1207107432"] Code: $src = imagecreatefromjpeg($source); I'm pretty sure the reason the gif won't work is because you are using imagecreatefromjpeg() instead of imagecreatefromgif(). I downloaded the image you attached and tried it using CI's library and it worked fine for me. I'm using CI v1.6.1. Here is my code: Code: $max_width = 600; Have you verified that your "source_image" and "new_image" locations are correct and that you have write access to the new_image location? Image Lib - Resize failure - El Forum - 04-02-2008 [eluser]gRoberts[/eluser] Hey thanks for the reply. I'm still using the CI code, but now I am using seperate code to calculate the size to resize to, and then passing these sizes directly rather then expect CI to handle it. Code: public function generate($source, $output, $width, $height) { |