ajslater / picopt

A multi format lossless image optimizer that uses external tools
GNU General Public License v3.0
108 stars 11 forks source link

Enhancement: use temporary directory #16

Closed grischard closed 7 months ago

grischard commented 8 years ago

The storage on which picopt is being run can be a bottleneck when generating all the optimised files.

It would be nice if picopt could take a --tempdir flag to copy the initial file there, optimise it, and replace the original file with the optimised one if it's better.

ajslater commented 7 months ago

picopt 4.0.0 does almost every operation in memory now.

The exception to this is the cwebp external program which has no stidin/stdout streaming capability. The available python bindings to cwebp also do not have sufficient options exposed to achieve as much optimization as calling the cli tool.

So most of the problem is solved, but cwebp will still create temporary files in the same directory as the optimized file. If this is still vexing, please open another issue.