Removing svgexport.

This commit is contained in:
sergiotarxz 2022-11-19 20:00:37 +01:00
parent c311f33494
commit b85308eca8
1 changed files with 10 additions and 11 deletions

View File

@ -134,15 +134,14 @@ sub PostPreviewOg {
my $svg = my $svg =
$self->_GenerateSVGPostPreview( $title, \@new_content, $post->{image} ); $self->_GenerateSVGPostPreview( $title, \@new_content, $post->{image} );
my $svgexport = path($ENV{HOME})->child('node_modules/.bin/svgexport'); my ( $stdout, $stderr ) = capture {
die "No svgexport." if !-f $svgexport; open my $fh, '|-', qw{convert /dev/stdin png:fd:1};
my $tmpdir = Path::Tiny->tempdir(); binmode $fh, 'utf8';
my $input = $tmpdir->child('input.svg'); print $fh $svg;
my $output = $tmpdir->child('output.png'); close $fh;
};
$input->spew_utf8($svg); say STDERR $stderr;
system $svgexport, $input, $output, 'png'; return $stdout;
return $output->slurp;
} }
sub _AttachImageSVG { sub _AttachImageSVG {