Brightcells / pngquant

A Python Wrapper of Pngquant
https://pypi.org/project/pngquant/
33 stars 7 forks source link

pngquant is not thread-safe #1

Closed erezarnon closed 4 years ago

erezarnon commented 6 years ago

Compress multiple images in threads. They overwrite each other.

agargara commented 5 years ago

Ran into the same issue. Workaround seems to be to use a different tmp_file for each thread. e.g.:

pngquant.config(tmp_file='unique_filename')
Brightcells commented 5 years ago

Change to generate tmp file random https://github.com/Brightcells/pngquant/commit/6ed0525056a5ce943bb3826cd29bc09f0edcae12