>OptiPNG is a tool for optimizing PNG images. And now, there’s an Ant task for executing it from an Ant build file:
Mini-HOWTO for Linux/UNIX/Mac OS X systems, assuming you already have Apache Ant installed:
- download OptiPNG source code from SourceForge (TAR GZ file)
- execute: ./configure
- execute: make
- execute: sudo make install
(enter your password if required); the command optipng is now installed in /usr/local/bin/ - download the optipng-ant-task source code from http://github.com/znerd/optipng-ant-task/downloads – take the latest version available (you can choose between a ZIP and a TAR GZ file)
- unpack the download file, this will create a new directory with an odd name like: znerd-optipng-ant-task-604de975b4cc4a1a2766e385c91b749318af038e (you may want to rename it to optipng-ant-task or so)
- in that directory, execute: ant
this will compile the classes, run the available unit test and build the JAR file
Then you can use the Ant task from your own build file, for example as follows:
<taskdef name="optipng" classname="com.pensioenpage.jynx.optipng.OptiPNGTask" classpath="lib/optipng-ant-task.jar" />
<optipng dir="src/htdocs" todir="build/htdocs" />