I am capturing a photo and saving it to the system.DocumentDirectory.
If I capture a new photo and save it with the same name, the old version of the picture is still displayed, even though the old file is removed
resultOK, errorMsg = os.remove(thePictureFile);
and the new photo is saved
local saveOption = { filename=pictureSavedAs, baseDir=system.DocumentsDirectory, captureOffscreenArea=true, backgroundColor={0,0,0,0} } display.save(photo, saveOption)
and when I look in the Project Sandbox - the file has in face been replaced.
I can even open an Overlay window several minutes later, and pass the filename as a parameter and the old version of the file (that is no longer in the Sandbox) is still displayed.
local showDownloadedPicture = display.newImageRect(sceneGroup,theFileName,system.DocumentsDirectory,totalWidth, totalHeight);
If I however close and re-open the Composer window, the new file is displayed correctly
Is there a “cache” that the Composer window (or Corona) uses, that could be cleared ?