1Mojolicious::Plugin::AsUsseetrPaCcokn:t:rPiibpuMeto:ej:doPlnPigec(ri3lo)uDso:c:uPmleungtiant:i:oAnssetPack::Pipe::Png(3)
2
3
4
6 Mojolicious::Plugin::AssetPack::Pipe::Png - Crush PNG image files
7
9 Application
10 plugin AssetPack => {pipes => ["Png"]};
11
12 # Forces the use of "optipng -clobber -preserve $input"
13 app->asset->pipe("Png")->app("optipng");
14
15 # Forces the use of "pngquant --speed 2 -"
16 app->asset->pipe("Png")->app("pngquant");
17
18 # Set custom application arguments:
19 app->asset->pipe("Png")->app("pngquant")->app_args([qw(--speed 10 --ordered -)]);
20
22 Mojolicious::Plugin::AssetPack::Pipe::Png can be used to crush "png"
23 image files.
24
25 This plugin has default settings for "pngquant" (default) and
26 "optipng". Which will be the default in the future is unknown, so force
27 the one you want in case that matters.
28
29 This pipe is EXPERIMENTAL. Feedback wanted.
30
31 TODO: Detect which application is installed and use the best available.
32
33 TODO: Add support for pngcrush.
34
36 app
37 $str = $self->app;
38 $self = $self->app("pngquant");
39
40 Can be used to set a custom application.
41
42 app_args
43 $array = $self->app_args;
44 $self = $self->app_args([qw(-clobber $input)]);
45
46 Can be used to set custom "app" arguments. The special $input string in
47 the argument list will be replaced with the path to a temp file holding
48 the image data.
49
50 If no $input element is found in the "app_args" list, then STDIN and
51 STDOUT will be used instead.
52
54 process
55 See "process" in Mojolicious::Plugin::AssetPack::Pipe.
56
58 Mojolicious::Plugin::AssetPack.
59
60
61
62perl v5.34.0 2M0o2j1o-l0i7c-i2o2us::Plugin::AssetPack::Pipe::Png(3)