Closed robmarkcole closed 5 years ago
It is a race condition, I think it can be resolved using flush
. http://discourse.techart.online/t/pil-wait-for-image-save/3994/9
In the meantime the folder_watcher
option works just fine, see here
To try:
output_filename = "cat_2.jpg"
out_file = open(output_filename, 'wb')
image.save(out_file, format='JPEG') # Must specify desired format here
out_file.flush()
os.fsync(out_file)
out_file.close()
print('saved cat_2.jpg')
I have confirmed that at least for me, this is actually an issue with my camera (blink) that sometimes does not update correctly. I am closing this issue unless someone can conclusively demonstrate that the issue is here
The
image_processing.file_saved
event is duplicating functionality of folder_watcher and sometimes causing old images to be fired in notifications as they have not yet saved to disk when the event is fired. Remove this event