Skip to content

OptiPNG with unix #147

rrelmy opened this Issue Mar 4, 2013 · 4 comments

2 participants

rrelmy commented Mar 4, 2013

I am using the build script under Fedora.
OptiPNG does not work as expected, so I tracked down the reason.
See issues: #39 #46

I want to ask if there are reasons for what had done before and if following suggestions would fix it without breaking Windows/Mac.

First problem: OptiPNG version regex

OptiPNG shows a new word «version» between name and number
See my commit rrelmy/ant-build-script@a259724

Second problem: / the strip-meta-tags argument

The variable is set to windows even on unix. In the «if os = unix» statment the variable is not set back to «unix» as in the imagesjpeg target.
Is there a reason for it?

The bigger problem build.xml:1002
Under unix the variable ${strip-meta-tags} is always set to an empty string.

If this variable is empty, an empty argument gets passed to optipng. When this happens following error occurs, see #39

** Error: The option -out requires one input file

This happens only if the variable is empty, if its set to «-strip all» everything works fine.


  1. correctly set ${}
  2. remove build.xml:1002
  3. if ${strip-meta-tags} is empty set it to something
    <equals arg1="${strip-meta-tags}" arg2="" />
        <var name="strip-meta-tags" value="-quiet"/>

Number 3 could be improved, but the argument «-quiet» two times should not make any trouble ;)
<apply> does not accept nested <if>'s ...

With those things fixed optipng works well under linux, but I dont know if it breaks building under Windows or Mac!


Fedora 64bit

$ ant -version
Apache Ant(TM) version 1.8.4 compiled on May 22 2012


$ optipng -version
OptiPNG version 0.7.4
@rrelmy rrelmy added a commit that referenced this issue Mar 4, 2013
@rrelmy rrelmy #147 - fix optipng under unix 92a5f74
H5BP member

Can you supply a pull request for the first problem?

Can you supply a separate pull request for the second problem so I can test it on Windows/Ubuntu and can maybe find someone with a Mac to test it.

@rrelmy rrelmy added a commit that referenced this issue Mar 5, 2013
@rrelmy rrelmy #147 - fix optipng under unix b34c8c8
rrelmy commented Mar 5, 2013

Sent you the two separate pull requests

@roblarsen roblarsen added a commit that referenced this issue Aug 6, 2013
@roblarsen roblarsen Reworked the two PNG tasks.
This will close
#163 Image Optimization Broken on Linux/Mac
#147 OptiPNG with unix
#141 You have optipng installed and your version is: usage: grep (Mac OS Lion Mountain)
#149 - fix optipng version regex
H5BP member

i hear nothing. i see nothing. i close.

@roblarsen roblarsen closed this Jan 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.