Change various things to make preview work

This commit is contained in:
swaggboi 2025-02-14 13:03:55 -05:00
parent b4a21c9e54
commit c5a3d1584f
3 changed files with 24 additions and 18 deletions

View File

@ -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:-');

BIN
me.avif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

24
to_avif.pl Executable file
View 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;