Hello!
I’m using display.save to create thumbnails, and since the user continually makes changes which requires updated thumbnails, the image content of those thumbnail image files change over the course of the app’s life.
When listing the thumbnails using display.newImage, i want to show the latest thumbnail, but since newImage caches images based on file-path, it keeps loading the old image data, causing the thumbnails to look outdated.
The suggestion in the doc is to always write to new file-names, but this does not sound like a very good solution and does not scale well with an unknown amount of changes to thumbnails.
I would like a way to avoid using the image cache when loading the thumbnail images.
A couple of ideas for how to achieve this:
- Another argument in the newImage function to control caching, defaulting to true.
- A separate function call to invalidate the image cache at a certain path, allowing the next call to read fresh.
- A method on the imageobject, forcing a re-read from already configred path and folder.
- A new display create method which is less clever and always reads from disk.
- Implement file-watching in corona which detects updated files on disk in the project sandbox, and matches those paths to cached images and invalidates them automatically.
Thoughts?
Thanks!