ant-build-script
ant-build-script copied to clipboard
Image optimization in subfolders
If there are jpegs in sub directory of the image_dir there are errors with jpegtran. Because the sub directory does not exists the image can't be saved:
[apply] .\jpegtran.exe: can't open .\publish\img\projekte\paf\screen.jpg for writing
Am I doing something wrong? :) This happens on windows and unix, I didnt check with mac.
I solved the nested directory problem by copying the directory structure before running the jpegtran tool:
<!-- Make sure nested directories exist -->
<copy todir="./${dir.publish}/${relative.image.dir}">
<dirset dir="${dir.source}/${relative.image.dir}"/>
</copy>
<apply executable="${jpegtran.executable}" dest="./${dir.publish}/${relative.image.dir}" osfamily="${os.family}">
...
</apply>
Don't know if this can also be applied to the other image processing tools.