Watermark Image

339 views
Skip to first unread message

Fatima

unread,
Mar 9, 2011, 4:22:27 AM3/9/11
to ResourceSpace
Can any one plesae let me know if is it possible to watermark only a
Screen Image. That is I only want the watermark to appear only on
Screen Image not preview or thumbnai.

Secondly is it possible to have only single watermark at the center
instead of tiled watermarks on the entire image this effects the
visibility of the entire image.

Thanks & Regards
Fatima

Bill

unread,
Mar 9, 2011, 5:14:36 PM3/9/11
to ResourceSpace
As far as I know it is not possible -- without code changes -- to
control where the watermark appears. But then again, we're new to
ResourceSpace so what do I know?

You should be aware, though, that if the watermark does not appear on
preview and thumbnail then it would be possible for the user to right-
click-copy and paste that image -- with no watermark -- into some
other program. This is true even if restricted access means they
cannot download the image.

Regarding your second question, it should be possible to create a
slightly larger watermark image, with transparent space around the
actual watermark text, to tune how it effects image visibility. I
suspect that if you add too much space, though, you might not see any
watermark at all on smaller images.

Bill Peterson

Bruce Harper

unread,
Mar 10, 2011, 2:02:43 PM3/10/11
to resour...@googlegroups.com
On Wednesday, March 9, 2011  Fatima wrote:
Secondly is it possible to have only single watermark at the center
instead of tiled watermarks on the entire image this effects the
visibility of the entire image.

From the solution I found back last summer:
The watermark is controlled in the image_processing.php script, once you set the "w" permission for a group when access is restricted and the watermark image is set in the config.php file.

Find this line in the image_processing.php script:

$runcommand = $command ." +matte $profile -resize " . $tw . "x" . $th . "\">\" -tile ".escapeshellarg($watermarkreal)." -draw\"rectangle 0,0 $tw,$th\" "..escapeshellarg($path);

Change it to add "-gravity Center" and add additional windows to show the watermark image:
$runcommand = $command ." +matte $profile -resize " . $tw . "x" . $th . "\">\" -gravity Center -tile ".escapeshellarg($watermarkreal)." -draw \"rectangle 10,23 213,69\" -draw \"rectangle 230,138 636,184\" -draw \"rectangle 230,438 636,482\" -draw \"rectangle 10,228 213,272\" ".escapeshellarg($path);


The key is the "tile" command that plasters the watermark all over the image, which in one way renders it useless for anyone to download and use without permission (which is what we want) but it also makes it difficult to see just what the details are in the image. The "gravity" tag combined with the "rectangle" gives a measure of control over the placement of the watermark by masking or only opening certain areas where the watermark image can be seen in the overlay on the various sizes of watermarked images that are created. In my case, I've tagged several locations that should cover enough of an image that should render it unusable for someone, but with enough visible for someone to be able to determine that it is the image to request permission to use (and be sent via email or download).

So, drop this line in your image_processing.php script and check the location of your watermark on the different images. For the smaller images, it will not give you the full image, but you will at least have something (tweak the starting x,y coordinates to shift it left if you wish) if you are using the 23x203 pixel PNG image provided with RS as a starting point. As the image sizes get larger, you will have more watermarks on the images. Add or remove rectangles (and play with the coordinates) as you desire to add or remove watermarks.

Bruce in Blacksburg
Webmaster, Virginia Tech
Web Communications, University Relations


Reply all
Reply to author
Forward
0 new messages