Change watermark size

See all posts Reply

Change watermark size new!
by Anabelle, 14 years ago
How can I change the watermark image size to fit the image width?Reply
Re: Change watermark size new!
by colin, 14 years ago
Not sure what you mean... But in any case, you cannot stretch the watermark. If you need a watermark the same size as you image, you may want to prepare the watermark first (you can even use the class for that)Reply
Re: Change watermark size new!
by Anabelle, 14 years ago
That's exactly what I mean.

How can I use the class to process the watermark so it has the same size of the upladed inage before using it as watermark.

I will make sure the watermark is large enough so it can always be shrinked to fit the image.

But I don't know how to do it.

Can you help me a bit?Reply
Re: Change watermark size new!
by colin, 14 years ago
There is no direct way to do what you want.

However, you can first process your uploaded image, and save it somewhere. Then, you read image_dst_x and image_dst_y.

You instanciate another class, and resize your watermark to these dimensions you got. Once your watermark is ready, you instantiate the class a third time, and apply the new watermark to the image you previously uploaded.

Note that if you don't need to resize the uploaded image, you can prepare your watermark before calling process() on the uplaoded image, reading image_src_x and image_src_y instead.Reply