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