简体   繁体   English

php gd库第二个imagejpeg无法正常工作

[英]php gd library second imagejpeg doesn't work

For some reason, only the first imagejpeg is working. 由于某些原因,只有第一个imagejpeg在工作。 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");

?>

imagestring expects an image resource, not a string with a pathname. imagestring需要图像资源,而不是带有路径名的字符串。 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). 您可能要使用createimagefrom *函数之一,或者继续使用现有的$image资源(毕竟,您已经按照自己的喜好保存了中间图像,为什么不将中间图像添加到同一图像之后又保存了宝贵的资源? cpu周期)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM