|
954 | 954 | <echo message=" "/>
|
955 | 955 | <echo message="First, we run optipng on the .png files..."/>
|
956 | 956 |
|
957 |
| - <!-- By default set strip-meta-tags to empty --> |
958 |
| - <var name="strip-meta-tags" value=""/> |
959 |
| - |
960 | 957 | <if>
|
961 | 958 | <equals arg1="${images.strip.metadata}" arg2="true"/>
|
962 | 959 | <then>
|
963 |
| - <var name="strip-meta-tags" value="-strip all"/> |
| 960 | + <var name="strip-meta-tags" value="-strip all"/> |
964 | 961 | </then>
|
| 962 | + <else> |
| 963 | + <var name="strip-meta-tags" value="-strip all"/> |
| 964 | + </else> |
965 | 965 | </if>
|
966 | 966 |
|
967 |
| - <!-- By default set os.family to windows, and optipng as available and it's executable --> |
968 |
| - <var name="os.family" value="windows"/> |
969 |
| - <var name="optipng.available" value="true"/> |
970 |
| - <var name="optipng.executable" value="${basedir}/${dir.build.tools}/${tool.optipng}"/> |
971 |
| - |
972 |
| - <!-- osfamily=unix is actually true on OS X as well --> |
973 |
| - <!-- On *nix's and OS X, check for optipng and give a helpful message if it's not installed --> |
974 |
| - <if> |
975 |
| - <os family="unix"/> |
976 |
| - <then> |
| 967 | + |
| 968 | + <if> |
| 969 | + <os family="windows"/> |
| 970 | + <then> |
| 971 | + <var name="optipng.available" value="true"/> |
| 972 | + <var name="optipng.executable" value="${basedir}/${dir.build.tools}/${tool.optipng}"/> |
| 973 | + </then> |
| 974 | + <else> |
977 | 975 | <if>
|
978 |
| - <!-- Then check for availability if unix --> |
979 |
| - <available file="optipng" filepath="${ENV.PATH}"/> |
980 |
| - <then> |
981 |
| - <var name="optipng.executable" value="optipng"/> |
982 |
| - <shellscript shell="bash" outputproperty="optipng.version"> |
983 |
| - optipng -version | grep -Po 'OptiPNG\s(version\s)?\d\.\d' | grep -Po '\d\.\d' |
984 |
| - </shellscript> |
985 |
| - <echo message="You have optipng installed and your version is: ${optipng.version}"/> |
986 |
| - </then> |
987 |
| - <else> |
988 |
| - <var name="optipng.available" value="false"/> |
989 |
| - </else> |
| 976 | + <!-- Then check for availability if unix --> |
| 977 | + <available file="optipng" filepath="${ENV.PATH}"/> |
| 978 | + <var name="optipng.executable" value="optipng"/> |
| 979 | + <if> |
| 980 | + <equals arg1="${images.optipng.newer}" arg2="true"/> |
| 981 | + <var name="optipng.available" value="true"/> |
| 982 | + </if> |
990 | 983 | </if>
|
991 |
| - <if> |
992 |
| - <equals arg1="${optipng.version}" arg2="0.7"/> |
993 |
| - <then> |
994 |
| - <var name="optipng.executable" value="optipng"/> |
995 |
| - </then> |
996 |
| - <else> |
997 |
| - <var name="optipng.available" value="false"/> |
998 |
| - </else> |
999 |
| - </if> |
1000 |
| - |
1001 |
| - <!-- Temporarily fixes #39 --> |
1002 |
| - <var name="strip-meta-tags" value=""/> |
1003 |
| - </then> |
1004 |
| - </if> |
1005 |
| - |
| 984 | + </else> |
| 985 | + </if> |
| 986 | + |
1006 | 987 | <!-- Now check for availability -->
|
1007 | 988 | <if>
|
1008 | 989 | <equals arg1="${optipng.available}" arg2="true"/>
|
|
1018 | 999 | </delete>
|
1019 | 1000 | </then>
|
1020 | 1001 | </if>
|
1021 |
| - |
1022 | 1002 | <!-- Run if available -->
|
1023 | 1003 | <for param="image-dir">
|
1024 | 1004 | <path>
|
|
1063 | 1043 | <!-- On *nix's and OS X, check for advpng and give a helpful message if it's not installed -->
|
1064 | 1044 |
|
1065 | 1045 | <echo message="Now, we run advpng on the .png files..."/>
|
1066 |
| - <!-- By default set os.family to windows, and optipng as available and it's executable --> |
1067 |
| - <var name="os.family" value="windows"/> |
1068 |
| - <var name="advpng.available" value="true"/> |
1069 |
| - <var name="advpng.executable" value="${basedir}/${dir.build.tools}/${tool.advpng}"/> |
1070 |
| - |
1071 |
| - <!-- osfamily=unix is actually true on OS X as well --> |
1072 |
| - <!-- On *nix's and OS X, check for optipng and give a helpful message if it's not installed --> |
1073 |
| - <if> |
1074 |
| - <os family="unix"/> |
1075 |
| - <then> |
| 1046 | + |
| 1047 | + <if> |
| 1048 | + <os family="windows"/> |
| 1049 | + <then> |
| 1050 | + <var name="advpng.available" value="true"/> |
| 1051 | + <var name="advpng.executable" value="${basedir}/${dir.build.tools}/${tool.advpng}"/> |
| 1052 | + </then> |
| 1053 | + <else> |
1076 | 1054 | <if>
|
1077 | 1055 | <!-- Then check for availability if unix -->
|
1078 | 1056 | <available file="advpng" filepath="${ENV.PATH}"/>
|
|
1083 | 1061 | <var name="advpng.available" value="false"/>
|
1084 | 1062 | </else>
|
1085 | 1063 | </if>
|
1086 |
| - </then> |
1087 |
| - </if> |
1088 |
| - |
| 1064 | + </else> |
| 1065 | + </if> |
| 1066 | + |
| 1067 | + |
1089 | 1068 | <!-- Now check for availability -->
|
1090 | 1069 | <if>
|
1091 | 1070 | <equals arg1="${advpng.available}" arg2="true"/>
|
|
1126 | 1105 | </else>
|
1127 | 1106 | </if>
|
1128 | 1107 | </target>
|
| 1108 | + |
1129 | 1109 | <target name="-imagesjpg" depends="-mkdirs" description="(PRIVATE) Optimizes .jpg images using jpegtan">
|
1130 | 1110 | <echo message="Now, we clean up those jpgs..."/>
|
1131 | 1111 |
|
|
0 commit comments