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….
Are you running on windows? If so check https://stackoverflow.com/questions/41289173/node-js-module-sharp-image-processor-keeps-source-file-open-unable-to-unlink
for me sharp.cache(false); worked
See also #415
Most helpful comment
Are you running on windows? If so check https://stackoverflow.com/questions/41289173/node-js-module-sharp-image-processor-keeps-source-file-open-unable-to-unlink
for me
sharp.cache(false);worked