ajslater / picopt

A multi format lossless image optimizer that uses external tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: use temporary directory

grischard opened this issue · comments

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.

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.