Gzip-Zopfli

 view release on metacpan or  search on metacpan

lib/Gzip/Zopfli.pod  view on Meta::CPAN

=head1 NAME

Gzip::Zopfli - Zopfli deflate/gzip compression library

=head1 SYNOPSIS

    
    use Gzip::Zopfli 'zopfli_compress';
    my $in = 'something' x 1000;
    my $out = zopfli_compress ($in);
    print length ($out), ' ', length ($in), "\n";
    


produces output

    62 9000


(This example is included as L<F<synopsis.pl>|https://fastapi.metacpan.org/source/BKB/Gzip-Zopfli-0.02/examples/synopsis.pl> in the distribution.)


=head1 VERSION

This documents version 0.02 of Gzip-Zopfli
corresponding to L<git commit 676163dc6d271a6f3682cf586ad342bbc1a42fd4|https://github.com/benkasminbullock/gzip-zopfli/commit/676163dc6d271a6f3682cf586ad342bbc1a42fd4> released on Thu Jul 27 13:00:41 2023 +0900.

This distribution also contains the source code of the Zopfli library
version 1.0.3. See L</COPYRIGHT & LICENCE> for the
conditions under which this source code may be used (Apache Licence,
copyright by Google Inc.)

=head1 DESCRIPTION

This module offers access to the Zopfli compression library from
Perl. Please note that the Zopfli does not offer decompression.

=head1 FUNCTIONS

=head2 zopfli_compress

    my $out = zopfli_compress ($in, %options);

Compress C<$in> into C<$out>. The possible options are as follows:

=over

=item blocksplitting

    my $out = zopfli_compress ($in, blocksplitting => 0);

Boolean. Apply blocksplitting or not? Default value is true.

=item blocksplittingmax

    my $out = zopfli_compress ($in, blocksplittingmax => 0);

Maximum number of blocks to split into. Default is 15. Set to 0 for
unlimited.

=item numiterations

    my $out = zopfli_compress ($in, numiterations => 1);

Number of iterations. Default value is 15.

=item type

    my $out = zopfli_compress ($in, type => 'zlib');

Type of compression. Either C<gzip> (the default), C<zlib>, or C<deflate>.

=back

=head2 zopfli_compress_file

    my $out = zopfli_compress_file (in => "file");

Compress from one file to another file:

    zopfli_compress_file (in => $file, out => "$file.gz");

Compress from data to a file:

    zopfli_compress_file (from => $data, out => 'compressed-file.gz');

It also accepts all the same options as L</zopfli_compress>.

=head1 DEPENDENCIES

=over

=item L<File::Slurper>

File::Slurper is used by L</zopfli_compress_file> to read and write
the files.

=back

=head1 SEE ALSO

=head2 About Zopfli

See L<https://github.com/google/zopfli>

=head2 CPAN

=over

=item Other implementations of Zopfli

=over

=item L<Compress::Zopfli>

=back

=item Other gzip/deflate/zlib compression libraries

=over

=item L<Compress::Raw::Zlib>

Interface to the Zlib compression library.



( run in 0.443 second using v1.01-cache-2.11-cpan-e1769b4cff6 )