[Watermark module] modification help

LGSilva

Joined: 2007-10-26
Posts: 5
Posted: Thu, 2007-11-01 21:22

Hello.
I'm trying to modify the watermark module so it can apply different watermarks depending on the size of the picture.
Right now the watermark works fine with my 640x480 images in landscape, but if the image is 480x640 (portrait) then my watermark will be too big for the image.

//edit
I've managed to locate the DownloadItem files but I'm not sure where or what to change as $this->do_something_amazing->something_else::magic it's kinda hard for me to understand, I'm more like if ($this = $that) then otherthing($this);
I know that the watermark module get the watermark image id and then load the image, the watermark and render they both and the function returns with a binary/mimetype thing.
Right now I just need to get it to read the file width and select watermark1 or watermark2 depending on that width.
Help please? :) Thank you
//end edit

My idea is to have different watermarks and for each one you can define the maximum width for it to be applied.
Example:

watermark_1.png (300px width)-> if current picture width >= 300px and <= 480px then apply this watermark
watermark_2.png (420px width)-> if current picture width >= 300px and <= 640px then apply this watermark

So in the case above the minimum width is taken from the watermark file and the maximum is defined by the user.

I was looking the .class files but my php is very amateur and oop is not my thing.

--- another idea ---

Almost the same thing but simpler:

You have two or more watermarks and define the width to which it should be used.

watermark_1.png -> if current picture width = 480px use this watermark.
watermark_2.png -> if current picture width = 640px use this watermark.

Any ideas?