dongtang7347 2010-07-20 15:53
浏览 18
已采纳

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

  • 写回答

1条回答 默认 最新

  • dtdr84101 2010-10-12 18:51
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器