Image resize and creating thumb not working together! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Image resize and creating thumb not working together! (/showthread.php?tid=71283) |
Image resize and creating thumb not working together! - webdevron - 07-27-2018 I am trying to upload an image to my server. After uploading, I want following actions: 1. If the image is larger than 600Kb, I want to reduce the image quality by 60% 2. If the image is larger than 300Kb, I want to reduce the image quality by 70% 3. After that, want to create thumb of the image. But these are not working together. Here is my code: Code: if(!$this->upload->do_upload('img')){ Thanks in advance for your help. RE: Image resize and creating thumb not working together! - php_rocs - 07-27-2018 @webdevron, Are you seeing any errors? RE: Image resize and creating thumb not working together! - webdevron - 07-27-2018 (07-27-2018, 05:48 AM)php_rocs Wrote: @webdevron, No there is no error. Just not working all together. RE: Image resize and creating thumb not working together! - InsiteFX - 07-27-2018 You did not say where this code is! I'am guessing that it's in a library because you are using the CI Controller object. Where is this code located? RE: Image resize and creating thumb not working together! - webdevron - 07-27-2018 (07-27-2018, 09:28 AM)InsiteFX Wrote: You did not say where this code is! I'am guessing that it's in a library This is the snippet of a function in main controller. This function is uploading image to my server. After uploading, I want to Reduce its size and Create a thumbnail RE: Image resize and creating thumb not working together! - John_Betong - 07-27-2018 @webdevron, Take a look at https://AmpProject.org because image dimensions are not mandatory as they can fit inside any fixed or responsive parent container. https://johns-jokes.cf/amp?app=2 Notice the web-page source script, about a dozen CSS lines are required to format the image. And not forgetting that images are stored freely using the Google CDN Cache |