I am getting the errors below:
Message: imagecreatefrompng(): SSL operation failed with code 1
Message: imagecreatefrompng(): Failed to enable crypto
when I run this code using PHP GD.
function image_test() {
$im = imagecreatefrompng(base_url()."assets/developed/images/center-poster-bg-transparent.png");
imagepng($im, APPPATH."../TESTIMAGE.png");
}
Can anybody help me out with why this is happening?
I guess you using codeigniter framework. I have the same problem earlier. And my solution is using the codeigniter parameter FCPATH.
Your code:
function image_test() {
$im = imagecreatefrompng(base_url()."assets/developed/images/center-poster-bg-transparent.png");
imagepng($im, APPPATH."../TESTIMAGE.png");
}
have to modify to
function image_test() {
$im = imagecreatefrompng( FCPATH."assets/developed/images/center-poster-bg-transparent.png" );
imagepng($im, APPPATH."../TESTIMAGE.png");
}
Hope it can help you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.