logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Mojolicious::Plugin::AssetPack::Pipe::Png - Crush PNG image files

Attributes

app
         $str = $self->app;
         $self = $self->app("pngquant");

       Can be used to set a custom application.

   app_args
         $array = $self->app_args;
         $self = $self->app_args([qw(-clobber $input)]);

       Can be used to set custom "app" arguments. The special $input string in the argument list will be
       replaced with the path to a temp file holding the image data.

       If no $input element is found in the "app_args" list, then STDIN and STDOUT will be used instead.

Description

       Mojolicious::Plugin::AssetPack::Pipe::Png can be used to crush "png" image files.

       This plugin has default settings for "pngquant" (default) and "optipng". Which will be the default in the
       future is unknown, so force the one you want in case that matters.

       This pipe is EXPERIMENTAL. Feedback wanted.

       TODO: Detect which application is installed and use the best available.

       TODO: Add support for pngcrush.

Methods

process
       See "process" in Mojolicious::Plugin::AssetPack::Pipe.

Name

       Mojolicious::Plugin::AssetPack::Pipe::Png - Crush PNG image files

See Also

       Mojolicious::Plugin::AssetPack.

perl v5.40.0                                       2024-12-07              Mojolicious::P...Pack::Pipe::Png(3pm)

Synopsis

Application
         plugin AssetPack => {pipes => ["Png"]};

         # Forces the use of "optipng -clobber -preserve $input"
         app->asset->pipe("Png")->app("optipng");

         # Forces the use of "pngquant --speed 2 -"
         app->asset->pipe("Png")->app("pngquant");

         # Set custom application arguments:
         app->asset->pipe("Png")->app("pngquant")->app_args([qw(--speed 10 --ordered -)]);

See Also