Sharp: Can't delete temp file after crop and save

Created on 11 Jun 2018  Â·  2Comments  Â·  Source: lovell/sharp

I am cropping an input image and then saving it to output file. but i want to remove the input one.

sharp(input)
.extract({ left: data.left, top: data.top, width: data.width, height: data.height })
.toFile(output, (err) => {
if(err){…
}else{
fs.unlink(input)….
}
});

When i try to unlink the temporal file node shows:
Error: EBUSY: resource busy or locked, unlink….

question

Most helpful comment

All 2 comments

See also #415

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulieo10 picture paulieo10  Â·  3Comments

jaydenseric picture jaydenseric  Â·  3Comments

vermin1337 picture vermin1337  Â·  3Comments

iq-dot picture iq-dot  Â·  3Comments

Andresmag picture Andresmag  Â·  3Comments