dongtang7347
dongtang7347
2010-07-20 15:53

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 dtdr84101 11年前

    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.

    点赞 评论 复制链接分享

相关推荐