file resize problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: file resize problem (/showthread.php?tid=11983) |
file resize problem - El Forum - 10-01-2008 [eluser]dimis[/eluser] I made a function in a helper that copy and resize photos. My problem is that since it copy and resize one image it does not do it with other images. What maybe wrong? Code: function photocopy($file,$height,$width,$path) Code: photocopy($this->config->item('pr').$this->data['product'][0]['color_photo'], file resize problem - El Forum - 10-01-2008 [eluser]dimis[/eluser] my problem is that each time the page is loading only one is copied. What may be wrong? file resize problem - El Forum - 10-01-2008 [eluser]GSV Sleeper Service[/eluser] well, by the looks of it you're using $this->config->item('prview') as the 'path', which is then being used as the filename for the resized image. $this->config items are usually static, so you're effectively overwriting the previously resized image each time you call this function. file resize problem - El Forum - 10-01-2008 [eluser]dimis[/eluser] I put Code: photocopy($this->config->item('pr').$this->data['product'][0]['color_photo'], At debugging all seem ok. The function is called 3 times at my example with the write arguments (/path/example1.jpg next /path/example2.jpg for example) but only one from the 3 are created. |