php - Script works on local, but not on live -
php - Script works on local, but not on live -
i trying write text on image. works fine on local system, not working when upload live server. code
$imgpath = base_url() . "public/images/mix/theatre.jpg"; $jpg_image = imagecreatefromjpeg($imgpath); // allocate color text $color = imagecolorallocate($jpg_image, 102, 20, 99); // set path font file $font_path = fcpath . "public/fonts/myriad pro.ttf"; //echo $font_path = base_url()."/public/fonts/myriad pro.ttf"; // set text printed on image $text = "now showing"; // print text on image $imagettf = imagettftext($jpg_image, 16, 0, 57, 140, $color, $font_path, $text); $savedimage = imagejpeg($jpg_image, $savetopath); var_dump($savedimage); it gives me same image copied $imgpath, text not written on it
you can utilize code
<?php header('content-type: image/png'); $im = imagecreatefromjpeg('includes/dir/something.jpg'); $black = imagecolorallocate($im, 0, 0, 0); $text=strtolower("now show"); $font = 'includes/dir/some.ttf'; imagettftext($im, 25, 0, 15, 33, $black, $font, $text); imagepng($im); imagedestroy($im); ?> its work me
php html image
Comments
Post a Comment