patches for a couple effects

2008-09-23
2012-09-15
  • Brian S. Julin
    Brian S. Julin
    2008-09-23

    The vertical shift without wrap is broken, and also shrink/expand when zooming. Both were obvious code typos. Patch:

    --- lives-0.9.9.2/lives-plugins/plugins/effects/RFXscripts/shrink_expand.script 2008-07-11 19:56:58.000000000 -0400
    +++ lives-0.9.9.2.fixes/lives-plugins/plugins/effects/RFXscripts/shrink_expand.script 2008-09-20 23:20:17.000000000 -0400
    @@ -100,6 +100,6 @@
    }
    else {
    - $center_x=$p3;
    - $center_y=$p4;
    + $center_x=$p2;
    + $center_y=$p3;
    }
    </pre>
    @@ -140,5 +140,5 @@
    if ($rscale>1.) {
    $resize_ext=$out_ext;
    - &zoom_frame($name,$center_x,$center_y,$height,$width,$rscale);
    + &zoom_frame($name,$center_x,$center_y,$width,$height,$rscale);
    }
    else {
    --- lives-0.9.9.2/lives-plugins/plugins/effects/RFXscripts/shift_vertical.script 2008-07-11 17:34:46.000000000 -0400
    +++ lives-0.9.9.2.fixes/lives-plugins/plugins/effects/RFXscripts/shift_vertical.script 2008-09-20 22:42:45.000000000 -0400
    @@ -62,5 +62,5 @@
    else {
    # composite translated original on blank
    - system("$composite_command -compose plus -dissolve 100 -geometry $width!x$height! $in -geometry +0!+$p0! blank$img_ext $out");
    + system("$composite_command -compose plus -dissolve 100 -geometry $width!x$height! $in -geometry +0!$p0! blank$img_ext $out");
    }
    $p0+=$p1;

    Also metacharacters in text overlay cause lots of problems. Partially fixable by using the multi-parameter form of system() but that leaves breakage given all the bash commandline passing between UI events/separate calls to the script.

    Snippet to try if anyone wants to work on this:

    <pre>

    tstring must be escaped to deal with convert parsing of singlequoted

    $tstring = $p0;
    $tstring =~ s/(\'|\)/\$1/gsm;
    </pre>

    <loop>
    $cstring1=&RGB24_to_string($p3_red,$p3_green,$p3_blue);
    $cstring2=&RGB24_to_string($p4_red,$p4_green,$p4_blue);
    $cstring1 =~ s/'//gsm;
    $cstring2 =~ s/'//gsm;
    system(split(' ',$convert_command), $in, '-fill', $cstring1, '-stroke', $cstring2, '-pointsize', $p5, '-draw', "text $p1 $p2 '$tstring'", $out);
    </loop>

    ...which of course will break if $convert_command contains spaces inside tokens. Better would be making available a @convert_command.

    Anyway like I said there's more funky stuff the above misses which require work in the core, especially with trailing backslashes.

     
    • Salsaman
      Salsaman
      2008-10-26

      Thanks. I have checked in the first two patches, they should be in the next release (0.9.9.4)

      The final patch for text overlay would be better handled by a subroutine in smogrify to escape meta-characters which can then be called from any effect/script. I will have a look into this.

      Regards,
      Gabriel.