•  » Engine
  •  » watermark configuration screen

#1 2012-04-21 23:22:38

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

watermark configuration screen

Hi,

I'm working on watermark configuration screen. Here is how my draft looks like.

http://piwigo.org/forum/showimage.php?pid=129282&filename=localhost+screen+capture+2012-4-21-23-19-23.png

Offline

 

#2 2012-04-29 09:38:06

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: watermark configuration screen

I've just commited this new screen in [Subversion] r14512 (see [Bugtracker] ticket 2626).

My problem is that I didn't find the correct algorithm to detect if a derivative must be updated or not : the $new_params->use_watermark is not correct. I don't know how to force Piwigo to take the new watermark configuration into account (in admin/include/configuration_watermark_process.inc.php). I will restart to work on it tonight.

rvelices, if you can take a look today, that would make the 2.4.0RC3 more sure to be released today :-)

Offline

 

#3 2012-04-29 13:17:50

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: watermark configuration screen

there is a small bug in ImageStdParam::apply_global, the parameter 'use_watermark' is correctly updated to 'true' but not to 'false'

Code:

Index: derivative_std_params.inc.php
===================================================================
--- derivative_std_params.inc.php  (revision 14512)
+++ derivative_std_params.inc.php  (working copy)
@@ -170,6 +170,10 @@
     {
       $params->use_watermark = true;
     }
+    else
+    {
+      $params->use_watermark = false;
+    }
   }
 
   private static function build_maps()

in addition to that Pierrick and I think sizes limits must be treated in OR mode instead of AND, allowing for exemple panoramas (1200*250) to have a watermark when small square (400*400) don't

Code:

Index: derivative_std_params.inc.php
===================================================================
--- derivative_std_params.inc.php  (revision 14512)
+++ derivative_std_params.inc.php  (working copy)
@@ -166,10 +166,14 @@
   {
     if (!empty(self::$watermark->file) &&
         (self::$watermark->min_size[0]<=$params->sizing->ideal_size[0]
-        && self::$watermark->min_size[1]<=$params->sizing->ideal_size[1] ) )
+        || self::$watermark->min_size[1]<=$params->sizing->ideal_size[1] ) )
     {
       $params->use_watermark = true;
     }

Offline

 

#4 2012-04-30 06:33:17

rvelices
Former Piwigo Team
2005-12-29
1960

Re: watermark configuration screen

mistic was right about setting the use_watermark

the algo should be straightforwared
for each get defined type map as param
{
old_wm = param->use_wm
apply_global(param)
if old_wm!=param->use_wm or
param->use_wm and wm changed)
{
... param has changed
}
}

Offline

 

#5 2012-04-30 11:45:27

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: watermark configuration screen

Thank you rvelices, I've fixed the form submission :-) [Subversion] r14580

Offline

 

#6 2012-04-30 12:09:37

rvelices
Former Piwigo Team
2005-12-29
1960

Re: watermark configuration screen

plg wrote:

Thank you rvelices, I've fixed the form submission :-) [Subversion] r14580

I think you don't need
$types[$type] = $params;
and
ImageStdParams::set_and_save($types);

just ImageStdParams::save();

because we are working with objects - they are never passed or returned by value (array, strings, basic types are ...). You are always working on the same instance (new ones are created explicitely by new, clone, unserialize ...)

Offline

 

#7 2012-04-30 13:08:43

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: watermark configuration screen

Perfect, thank you rvelices, [Subversion] r14584

Offline

 

#8 2012-05-11 21:43:43

PeteSlaughter
Guest

Re: watermark configuration screen

Will this include the watermark utility?



Thanks,
Pete

 

#9 2012-05-12 21:32:31

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: watermark configuration screen

PeteSlaughter wrote:

Will this include the watermark utility?

What do you mean?

Offline

 
  •  » Engine
  •  » watermark configuration screen

Board footer

Powered by FluxBB

github linkedin newsletter Piwigo.org © 2002-2026 · Contact