patches for a couple effects

  • Brian S. Julin
    Brian S. Julin

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

    --- lives- 2008-07-11 19:56:58.000000000 -0400
    +++ lives- 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;
    @@ -140,5 +140,5 @@
    if ($rscale>1.) {
    - &zoom_frame($name,$center_x,$center_y,$height,$width,$rscale);
    + &zoom_frame($name,$center_x,$center_y,$width,$height,$rscale);
    else {
    --- lives- 2008-07-11 17:34:46.000000000 -0400
    +++ lives- 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");

    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:


    tstring must be escaped to deal with convert parsing of singlequoted

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

    $cstring1 =~ s/'//gsm;
    $cstring2 =~ s/'//gsm;
    system(split(' ',$convert_command), $in, '-fill', $cstring1, '-stroke', $cstring2, '-pointsize', $p5, '-draw', "text $p1 $p2 '$tstring'", $out);

    ...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

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

      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.