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 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示