Skip to content
This repository was archived by the owner on Nov 23, 2018. It is now read-only.
This repository was archived by the owner on Nov 23, 2018. It is now read-only.

Include pngquant in image optimization process #37

Open
@cmalven

Description

@cmalven

A site I'm currently working on makes very heavy use of transparent PNGs, and I've found that by running pngquant on the entire project I can get tremendous savings in file size.

I'm sure you see where I'm going with this. I'd love to have the build script do this for me. It seems like it would be pretty simple, and I've already taken an unsuccessful stab at it:

<echo message="Now, we run pngquant on the .png files for much smaller files..."/>

<apply executable="${basedir}/${dir.build.tools}/pngquant.exe" dest="./${dir.publish}/${dir.images}/" osfamily="unix">
    <fileset dir="./${dir.source}/${dir.images}/" includes="**/*.png"  excludes="${images.bypass}, ${images.default.bypass}"/>
    <arg value="-ext .png -force"/>
    <arg value="256"/>
    <targetfile/>
    <srcfile/>
    <mapper type="identity"/>
</apply>

-ext .png -force forces a replace of the existing files, and 256 sets the amount of colors to use. These are the only args I've ever needed for pngquant.

The "pngquant.exe" is in the place it should be. In fact, the build script is finding it and displaying the "help" for it, but then the script just hangs which makes me think my settings somewhere else are incorrect. I know nothing about working with Ant, and the documentation is pretty intimidating (the Ant documentation, not the HTML5BP docs, which are great).

Anybody have any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions