Watermarks and derestricted resources

132 views
Skip to first unread message

Stephen

unread,
Mar 21, 2015, 5:49:29 PM3/21/15
to resour...@googlegroups.com
Why do watermarks appear on derestricted resources?

I have user groups based on geographic region (Asia, Europe, North America, South America, etc) which is captured in a metadata field. Users should have open access to resources within their own region. And they should have restricted access to everything else. I've set this up by using permission g to restrict access to all available resources, and then using the derestrict filter to allow each group access to their specific region (e.g. region=Asia). Works fine.

Problem comes up when I turn on watermarks. Every single thumbnail on the user's search results page has a watermark -- the resources from the other regions (which is good) but also the resources from the user's own region (which is bad). Things work as expected once you go to the resource detail page. But it's super confusing that all search result thumbnails have watermarks on the search results page whether they've been derestricted or not.

I want derestricted resource thumbnails NOT to have watermarks. I've looked around for an answer but can't find one -- and updating the previews doesn't help.

Is there a way to do this -- i.e no watermarks on derestricted images?

Thanks!
Stephen

Allison Stec

unread,
Mar 23, 2015, 9:38:52 AM3/23/15
to ResourceSpace
From what I can tell, check_use_watermark isn't considering derestrict filters, though maybe this is being done upstream...so I don't think this is possible right now.

Check to see if you have $watermark_open=true in your config.php file or group config overrides. If it's there, get rid of it.

Allison Stec
Senior Developer & Asset Management Specialist
Colorhythm
http://www.colorhythm.com

Main Office: +1 415-399-9921
Fax: +1 415-399-9928

as...@colorhythm.com

--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.org
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen

unread,
Mar 24, 2015, 3:00:54 AM3/24/15
to resour...@googlegroups.com
Thanks Allison. Your comments got me thinking the right way. What I ended up doing was adding the following code to each of the three search views (smallthumbs.php, thumbs.php, and xlthumbs.php) after where it currently calls check_use_watermark. This forces it to rethink whether it needs a watermark or not on a resource by resource case based on the derestrict filter rather than globally. Perhaps there's a more elegant way to do this with an include, hook, or smartly changing check_use_watermark. For now, this will get me where I need to be.

$metadata=get_resource_field_data($result[$n]['ref'],false,false);
$userderestrictfilter=$userdata[0]["derestrict_filter"];

for ($z=0;$z<count($metadata);$z++)
{
    $name=$metadata[$z]["name"];
    $value=$metadata[$z]["value"];
   
    if ($name!="")
    {
        $match=filter_match($userderestrictfilter,$name,$value);
        if ($match==1) {$use_watermark=true;} // If no match, show watermark
        if ($match==2) {$use_watermark=false;} // If match, do not show watermark

Jp Dn

unread,
Aug 7, 2015, 11:21:18 AM8/7/15
to ResourceSpace
Alternaively if you never wants watermarked thumbs, you can replace in smallthumbs.php, thumbs.php, and xlthumbs.php

$thm_url=get_resource_path($ref,false,"thm",false,$result[$n]["preview_extension"],-1,1,$use_watermark,$result[$n]["file_modified"]); // original code

with :

// never use watermark for thumbs: remplace $use_watermark by 0
$thm_url=get_resource_path($ref,false,"thm",false,$result[$n]["preview_extension"],-1,1,0,$result[$n]["file_modified"]);

-
J.Philippe / Itchiweb.com
Reply all
Reply to author
Forward
0 new messages