![]() |
image_create_gd - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: image_create_gd (/showthread.php?tid=67040) Pages:
1
2
|
image_create_gd - Knutsford - 01-06-2017 png's are not working in image_create_gd I have put error_reporting(E_ALL); ini_set('display_errors', 1); Bu there are no error messages, log messages or anything to what what the problem is Code: function image_create_gd($path = '', $image_type = '') echo "xxxx - aa"; is coming out echo "xxxx - cc"; is coming out then echo "xxxx - eee"; is coming out so imagecreatefrompng exists echo $path; gives home/sweetlocation/public_html/assets/properties/216841/md/1.png $a = getimagesize($path); echo "width = " . $a[0]; echo "height = " . $a[1]; echo "type = " . $a[2]; gives width = 620height = 413type = 3 Then nothing at all. No echo messages, log messages or error messages. It just stops 100% dead on imagecreatefrompng($path). I have no idea why or what to do RE: image_create_gd - Narf - 01-06-2017 What happens if you manually call imagecreatefrompng($theImagePath) ? Not inside CI, just in a one-line PHP script or via php -a under CLI. RE: image_create_gd - Knutsford - 01-06-2017 That works I have uploaded a test page <?php error_reporting(E_ALL); ini_set('display_errors', 1); $path = "/home/sweetlocation/public_html/assets/properties/216841/md/1.png"; echo $path; $a = getimagesize($path); echo "width = " . $a[0]; echo "height = " . $a[1]; echo "type = " . $a[2]; $test = imagecreatefrompng($path); echo $test; echo "hhhh"; ?> and I get /home/sweetlocation/public_html/assets/properties/216841/md/1.pngwidth = 620height = 413type = 3Resource id #3hhhh Does that give a clue as to what the problem is? RE: image_create_gd - Narf - 01-06-2017 No, and the only difference I see is that there's no leading slash for $path in your first post - that is very important, so it may be the cause if it's a typo. RE: image_create_gd - Knutsford - 01-06-2017 There is a / - sorry it got missed when pasting I have no idea what to do then RE: image_create_gd - Narf - 01-06-2017 Well, then the issue is probably not inside image_create_gd() ... RE: image_create_gd - Knutsford - 01-06-2017 I has to be Case 3 is now 100% the same as my test page Test page <?php error_reporting(E_ALL); ini_set('display_errors', 1); $path = "/home/sweetlocation/public_html/assets/properties/216841/md/1.png"; echo $path; $a = getimagesize($path); echo "width = " . $a[0]; echo "height = " . $a[1]; echo "type = " . $a[2]; $test = imagecreatefrompng($path); echo $test; echo "hhhh"; ?> Cae 3 case 3 : $path = "/home/sweetlocation/public_html/assets/properties/216841/md/1.png"; echo $path; $a = getimagesize($path); echo "width = " . $a[0]; echo "height = " . $a[1]; echo "type = " . $a[2]; $test = imagecreatefrompng($path); echo $test; echo "hhhh"; return "bbb"; Test page I get /home/sweetlocation/public_html/assets/properties/216841/md/1.pngwidth = 620height = 413type = 3Resource id #3hhhh switch 3 I only get /home/sweetlocation/public_html/assets/properties/216841/md/1.pngwidth = 620height = 413type = 3 RE: image_create_gd - Narf - 01-06-2017 I don't understand how that shows anything or that it "has to be". You're not even showing how you're triggering image_create_gd() ... Also, please use the code formatting provided by the forum; it's very hard to read your posts. RE: image_create_gd - Knutsford - 01-06-2017 (01-06-2017, 09:25 AM)Narf Wrote: I don't understand how that shows anything or that it "has to be". You're not even showing how you're triggering image_create_gd() ... Sorry - the quick reply doesn't have formatting which was why. This is the code that should do the resize Code: if ($index >= $limit) { CONTINUE; } RE: image_create_gd - Knutsford - 01-06-2017 (01-06-2017, 09:45 AM)Knutsford Wrote:(01-06-2017, 09:25 AM)Narf Wrote: I don't understand how that shows anything or that it "has to be". You're not even showing how you're triggering image_create_gd() ... |