Skip to content

Commit

Permalink
Another way to fix shutter-project#697
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGandalf committed Sep 11, 2024
1 parent cdbb6ea commit 8028d6c
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions share/shutter/resources/system/plugins/perl/spwatermark/spwatermark
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use Glib qw/TRUE FALSE/;
use FindBin '$Bin'; #path where plugin is located
use File::Temp qw/ tempfile tempdir /;
use Time::HiRes qw/usleep/;
use IPC::Run3;

#load modules at custom path at runtime
#--------------------------------------
Expand Down Expand Up @@ -351,19 +352,21 @@ sub apply_effect {
my $color = $stroke_color->get_color;

#execute imagemagick command
my $command1 = "convert" .
" -background '#00000000'" .
" -fill " . "'" . sprintf( "#%04x%04x%04x%04x", $color->red, $color->green, $color->blue, $stroke_color->get_alpha ) . "'" .
" -pointsize " . $psize .
" -gravity " . $gravity_combo->get_active_text .
" -rotate " . $angle_sbutton->get_value .
" label:$text " . $tmpfilename;
my $output1 = `$command1`;

my $command2 = "composite " . $tmpfilename .
" -gravity " . $gravity_combo->get_active_text .
" " . $filename . " " . $tmpfilename2;
my $output2 = `$command2`;
run3 ["convert",
"-background", '#00000000',
"-fill", sprintf( "#%04x%04x%04x%04x", $color->red, $color->green, $color->blue, $stroke_color->get_alpha ),
"-pointsize", $psize,
"-gravity", $gravity_combo->get_active_text,
"-rotate", $angle_sbutton->get_value,
"label:$text", $tmpfilename,
];

run3 ["composite",
$tmpfilename,
"-gravity", $gravity_combo->get_active_text,
$filename,
$tmpfilename2,
];
}

sub fct_update_gui {
Expand Down

0 comments on commit 8028d6c

Please sign in to comment.