CodeIgniter Forums
png image resize - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: png image resize (/showthread.php?tid=66997)



png image resize - Knutsford - 12-30-2016

copy($image, $target);
              
                // resize to 'md' size
                $resize_config['source_image'] = $target;
                $resize_config['new_image'] = $target;
                $resize_config['width'] = $dimensions['width'];
                $resize_config['height'] = $dimensions['height'];
                $resize_config['master_dim'] = 'width';
               
                $ci->image_lib->initialize($resize_config);
              
                $ci->image_lib->resize();




It works for jpg images but not png images. For a png image it is doing the copy to the target directory then stopping when it comes to the resize



The original size is Width = 620px Height = 413px


The array for setting the new size is array ('width' => 685, 'height' => 526)





Thanks