fix(tools): use netpbm tools instead of imagemagick

main
Tsu-ba-me 3 years ago
parent 65613f501b
commit c1859bc8d8
  1. 7
      tools/anvil-get-server-screenshot

@ -49,13 +49,14 @@ sub get_server_screenshot
{ {
my $parameters = shift; my $parameters = shift;
my $server_uuid = $parameters->{server_uuid}; my $server_uuid = $parameters->{server_uuid};
my $resize_args = $parameters->{resize_args}; my ($resize_x, $resize_y) = split(/x/ , $parameters->{resize_args});
my $shell_call = "virsh screenshot --domain ".$server_uuid." --file /dev/stdout | sed 's/Screenshot.*//'"; my $shell_call = "virsh screenshot --domain ".$server_uuid." --file /dev/stdout | sed 's/Screenshot.*//'";
if (defined $resize_args) if ($resize_x =~ /^\d+$/ && $resize_y =~ /^\d+$/)
{ {
$shell_call .= " | convert - -resize ".$resize_args." png:-"; $shell_call .= " | pamscale -quiet -xyfit ".$resize_x." ".$resize_y;
$shell_call .= " | pamtopng -quiet";
} }
$shell_call .= " | base64 --wrap 0"; $shell_call .= " | base64 --wrap 0";

Loading…
Cancel
Save