![]() |
Cannot resize, then watermark the same image in CodeIgniter - 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: Cannot resize, then watermark the same image in CodeIgniter (/showthread.php?tid=60415) |
Cannot resize, then watermark the same image in CodeIgniter - El Forum - 03-21-2014 [eluser]therealjerdev[/eluser] When I try doing multiple things, say resize, then watermark the same image. Only the first process [resizing] works, but the second does not. here is my code, I factored out the manipulation into a new library. my controller: Code: function upload() my library: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); I just can't get why it wont run multiple manipulation processes on the same image, one after the other... Cannot resize, then watermark the same image in CodeIgniter - El Forum - 03-22-2014 [eluser]letsgolee[/eluser] I think there is no font information given. So even though watermark is made there will no text overlayed. Below is the example of font configuration. Code: $config['wm_font_path'] = './system/fonts/texb.ttf'; Cannot resize, then watermark the same image in CodeIgniter - El Forum - 03-22-2014 [eluser]therealjerdev[/eluser] [quote author="letsgolee" date="1395490379"]I think there is no font information given. So even though watermark is made there will no text overlayed. Below is the example of font configuration. Code: $config['wm_font_path'] = './system/fonts/texb.ttf'; [/quote] Hmm, those configs should be already defaulted if not defined by me. But anyways, I tried it anyways and it still wont work. My code seems pretty logical to you right? Can't seem to see why it won't work out.. :/ My thinking is that the second process [watermarking] gets executed before the last one was fully saved to disk, but that shouldn't be the case because php should wait for a return [true] from the resize method called. and since it does, the image should have already been saved to disk.. which in turn would go to the next 'watermarking'... Cannot resize, then watermark the same image in CodeIgniter - El Forum - 03-22-2014 [eluser]therealjerdev[/eluser] Wow, weird, anyways, all I had to do was watermark it first, and THEN resize it. I couldn't do it the other way around which was weird... I also had to change, within the watermark function in my Manipulate_img class, Code: $this->session->userdata('username') Code: $this->CI->session->userdata('username') |