Hi,
I'm working on watermark configuration screen. Here is how my draft looks like.
Offline
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
there is a small bug in ImageStdParam::apply_global, the parameter 'use_watermark' is correctly updated to 'true' but not to 'false'
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
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
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
Thank you rvelices, I've fixed the form submission :-) [Subversion] r14580
Offline
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
Perfect, thank you rvelices, [Subversion] r14584
Offline
Will this include the watermark utility?
Thanks,
Pete
PeteSlaughter wrote:
Will this include the watermark utility?
What do you mean?
Offline