Mojolicious::Plugin::AssetPack::Pipe::Png(3pm) | User Contributed Perl Documentation | Mojolicious::Plugin::AssetPack::Pipe::Png(3pm) |
Mojolicious::Plugin::AssetPack::Pipe::Png - Crush PNG image files
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 -)]);
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.
$str = $self->app; $self = $self->app("pngquant");
Can be used to set a custom application.
$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.
See "process" in Mojolicious::Plugin::AssetPack::Pipe.
Mojolicious::Plugin::AssetPack.
2023-02-04 | perl v5.36.0 |