php gd 库第二个 imagejpeg 不起作用
由于某种原因,只有第一个 imagejpeg 正在工作。帮助?
完整代码
<?php
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $opacity);
imagejpeg($image, "modified-images/".$codigo2."_modified_picture_status_".$status.".jpg");
$image2 = "modified-images/".$codigo2."_modified_picture_status_".$status.".jpg";
imagestring($image2, $font_number, $x_position, $y_position, $text, $drawing_color);
imagejpeg($image2, "modified-images/".$codigo2."_modified_withtext_picture_status_".$status.".jpg");
?>
For some reason, only the first imagejpeg is working. help?
FULL CODE
<?php
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $opacity);
imagejpeg($image, "modified-images/".$codigo2."_modified_picture_status_".$status.".jpg");
$image2 = "modified-images/".$codigo2."_modified_picture_status_".$status.".jpg";
imagestring($image2, $font_number, $x_position, $y_position, $text, $drawing_color);
imagejpeg($image2, "modified-images/".$codigo2."_modified_withtext_picture_status_".$status.".jpg");
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
imagestring
需要图像资源,而不是带有路径名的字符串。您可能想使用 createimagefrom* 函数之一,或者继续使用现有的$image
资源(毕竟,您已经按照自己喜欢的方式保存了中间图像,为什么不在之后添加文本到相同的图像,并节省宝贵的 CPU 周期)。imagestring
expects an image resource, not a string with a pathname. You probably want to use one of the createimagefrom* functions, or continue working with your existing$image
resource (after all, you already saved the intermediate image how you liked it, why not after that add text to the same image, and save precious cpu cycles).