Remove virtual files before running (fixes #217) (#220)

This commit is contained in:
Surma
2018-10-19 12:07:01 +01:00
committed by Jake Archibald
parent 11ee74e224
commit 49b40b1c3e
3 changed files with 3 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ struct OptiPngOpts {
uint8_t* result;
val compress(std::string png, OptiPngOpts opts) {
remove("input.png");
remove("output.png");
FILE* infile = fopen("input.png", "wb");
fwrite(png.c_str(), png.length(), 1, infile);
fflush(infile);