Change various things to make preview work
This commit is contained in:
parent
b4a21c9e54
commit
c5a3d1584f
@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env perl
|
|
||||||
|
|
||||||
use v5.36;
|
|
||||||
use Image::Magick;
|
|
||||||
|
|
||||||
unless ($ARGV[0]) {
|
|
||||||
say "give me image file, e.g.: $0 goatse.jpeg";
|
|
||||||
exit 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $p = Image::Magick->new;
|
|
||||||
my $file = $ARGV[0];
|
|
||||||
|
|
||||||
$p->Read($file);
|
|
||||||
|
|
||||||
# Write to STDOUT instead of file
|
|
||||||
binmode STDOUT;
|
|
||||||
$p->Write('avif:-');
|
|
24
to_avif.pl
Executable file
24
to_avif.pl
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use v5.36;
|
||||||
|
use Image::Magick;
|
||||||
|
|
||||||
|
unless ($ARGV[0]) {
|
||||||
|
say "give me image file, e.g.: $0 goatse.jpeg";
|
||||||
|
exit 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $p = Image::Magick->new;
|
||||||
|
my $file = $ARGV[0];
|
||||||
|
|
||||||
|
$p->Read($file);
|
||||||
|
|
||||||
|
my $image_avif = $p->Clone;
|
||||||
|
$image_avif = $image_avif->ImageToBlob(magick => 'avif');
|
||||||
|
|
||||||
|
my $preview_avif = $p->Clone;
|
||||||
|
$preview_avif->Zoom('25%');
|
||||||
|
$preview_avif = $preview_avif->ImageToBlob(magick => 'avif');
|
||||||
|
|
||||||
|
#print $image_avif;
|
||||||
|
print $preview_avif;
|
Loading…
x
Reference in New Issue
Block a user