CodeIgniter Forums
Image Upload & Resize - 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 Upload & Resize (/showthread.php?tid=8475)



Image Upload & Resize - El Forum - 05-19-2008

[eluser]RRosset[/eluser]
Hello, i read a lot about upload & resize images, i read a lot and i wasn't able to find a solution yet.

I'm gonna post two codes, referring to them as code1 and code2

CODE 1
Code:
$config['image_library'] = 'GD2';
$config['source_image'] = $full_path;
$config['create_thumb'] = FALSE;
$config['new_image'] = $file_path.'xyz/';
$config['maintain_ratio'] = TRUE;
$config['width'] = 550;
$config['height'] = 455;

$this->image_lib->initialize($config);
$this->image_lib->resize();

$this->image_lib->clear();


CODE 2
Code:
$config['image_library'] = 'GD2';
$config['source_image'] = $full_path;
$config['create_thumb'] = FALSE;
$config['new_image'] = $file_path.'large/';
$config['maintain_ratio'] = TRUE;
$config['width'] = 550;
$config['height'] = 455;

$this->image_lib->initialize($config);
$this->image_lib->resize();

$this->image_lib->clear();

The first code, works, the second one doesn't. Probably you're gonna say, it's a CHMOD issue! well. I Use the same folder, just rename it to a new name. If i change the new_image value to... for example, wer, it works, but zxc doesn't, big_image doesn't, but products does. Finally i created the large view in a xyz folder, but it's a weird problem. Ha! if someone noticed that before and fixed it, please lemme know what's wrong. I don't care about a fast solution since i solved the issue with a new folder, but... isn't it a really annoying problem?

Thanks in advance,

Bob


Image Upload & Resize - El Forum - 05-19-2008

[eluser]Seppo[/eluser]
Hey Bob,

have you tried to look at $this->image_lib->display_errors(); // ? =)


Image Upload & Resize - El Forum - 05-19-2008

[eluser]RRosset[/eluser]
No luck at all. I did it before but nothing happens. I mean, a blank page. I tried both print_r and die (also die plus .'asd' just in case the die is not showing up). I remove 777 permission in other folder and yes, i get the error message. So i'm kinda lost! hahaha thanks Wais btw.

And remember to IM Muni and Lucas in order to laugh of them 'cause of the soccer match.

Bob