[pacman-dev] [PATCH 1/1] add option to optimize PNG images with optipng
Christian Hesse
list at eworm.de
Sat Jan 24 18:35:58 UTC 2015
Allan McRae <allan at archlinux.org> on Sat, 2015/01/24 16:17:
> On 24/01/15 00:40, Florian Pritz wrote:
> > On 22.01.2015 09:36, Christian Hesse wrote:
> >> --- a/scripts/makepkg.sh.in
> >> +++ b/scripts/makepkg.sh.in
> >> @@ -1918,6 +1918,17 @@ tidy_install() {
> >> fi
> >> done
> >> fi
> >> +
> >> + if check_option "optipng" "y"; then
> >> + msg2 "$(gettext "Optimizing PNG images...")"
> >> + local png
> >> + find . -type f -iname "*.png" 2>/dev/null | while read
> >> -r png ; do
> >> + if [[ $(file -bi "$png") = *'image/png'* ]];
> >> then
> >
> > Better use "file -b --mime-type" and get rid of the globs.
Agreed.
> hrm... is there a reason why we don't use this elsewhere in makepkg?
My code is based on the upx functionality. So we want to change it there as
well?
> >> + optipng "$png" &>/dev/null ||
>
> Do this:
>
> optipng $OPTIPNGFLAGS "$png" &>/dev/null ||
>
> then people can specify options they want to pass to optipng - see the
> upx option.
Sounds reasonable. I will prepare a new patch.
> >> + warning "$(gettext "Could not
> >> optimize PNG image : %s")" "${png/$pkgdir\//}"
> >> + fi
> >> + done
> >> + fi
> >> }
> >>
> >> find_libdepends() {
> >
> >
--
main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];)
putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20150124/cf73c594/attachment.asc>
More information about the pacman-dev
mailing list