|
|
|
PHP Write text in Images error รบกวนช่วยดูหน่อยค่ะ |
|
|
|
|
|
|
|
ใช้ code นี้ค่ะ
Code (PHP)
<?php
echo "<img src=MyResize/pic1.jpg>";
$string = "Narak Girl By ThaiCreate.Com"; // String
$im = ImageCreateFromJpeg("MyResize/pic1.jpg"); // Path Images
$color = ImageColorAllocate($im, 255, 0, 0); // Text Color
$pxX = (Imagesx($im) - 6.5 * strlen($string))/2; // X
$pxY = Imagesy($im)- 20; // Y
ImageString($im, 200, $pxX, $pxY, $string, $color);
imagePng($im,"MyResize/pic1.jpg");
ImageDestroy($im);
?>
แต่ error
Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 5
Warning: imagecreatefromjpeg(): 'MyResize/pic1.jpg' is not a valid JPEG file in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 5
Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 6
Warning: imagesx() expects parameter 1 to be resource, boolean given in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 7
Warning: imagesy() expects parameter 1 to be resource, boolean given in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 8
Warning: imagestring() expects parameter 1 to be resource, boolean given in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 9
Warning: imagepng() expects parameter 1 to be resource, boolean given in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 10
Warning: imagedestroy() expects parameter 1 to be resource, boolean given in D:\DREAMWABVERCS6\XAMPP\htdocs\addpic\addpic.php on line 11
Tag : PHP
|
|
|
|
|
|
Date :
2016-08-26 14:32:06 |
By :
sammam |
View :
824 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองตรวจสอบ Path ของรูปนะครับ ว่าสามารถเรียกได้ปกติหรือไม่
|
|
|
|
|
Date :
2016-08-29 10:26:25 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|