phpThumb - 更改水印大小

发布于 2024-09-10 15:19:13 字数 185 浏览 4 评论 0原文

我在脚本中使用 phpThumb 来清理图像并为其添加水印。我们的图像尺寸非常不同(从 100 像素宽度到 800 像素),因此无论我使用什么水印图像,它在图像上要么看起来太小,要么太大。

您知道如何告诉 phpThumb 调整水印大小吗?或者有没有办法调整水印图像的大小(取决于加水印的图像的大小)?

非常感谢大家! 阿里

I'm using phpThumb in a script to clean my images and add a watermark to them. We have images of very different sizes (from 100px width to 800px), so no matter what watermark image I use, it's either going to look too small or too big on the image.

Do you know of a way to tell phpThumb to resize the watermark? Or is there a way to resize the watermark image (depending on size of image being watermarked)?

Thanks a lot guys!
Ali

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱了心跳 2024-09-17 15:19:13

我面临着同样的问题。

也许您可以在 phpthumb.config 文件的默认参数部分中放置一些 if 语句,

然后根据高度和宽度参数,您可以决定使用具有不同大小的水印的不同文件。

确保将 $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE 更改为 false

这并不完美,因为您无法知道源图像的大小。

但根据传递给 phpthumb 的参数,它会更合适。

我想唯一的其他解决方案是使用 phpthumb 作为对象,但这需要大量工作。

I am facing the same issue.

Maybe you could put some if statements in the phpthumb.config file in the DEFAULT PARAMETER SECTION

then depending on the height and width parameters you can decide to use different files with varying sizes for the watermark.

make sure you change $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE to false

This is not perfect cause you could not know the source image size to start with.

but it would be a better fit based on the parameters passed to phpthumb.

I guess the only other solution would be to use phpthumb as an object but that would require a lot of work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文