我看到这些线条:
21 // destination x and y
22 $imageWidth-$logoWidth, $imageHeight-$logoHeight,
Run Code Online (Sandbox Code Playgroud)
这可能是从水印开始写入的位置(减去图像的宽度)底部(减去高度)点的右侧(减去图像的宽度).
尝试并将其替换为例如左上角:
21 // destination x and y
22 0 , 0,
Run Code Online (Sandbox Code Playgroud)
或者如果你想要左下角,试试:
21 // destination x and y
22 0 , $imageHeight-$logoHeight,
Run Code Online (Sandbox Code Playgroud)