-
Notifications
You must be signed in to change notification settings - Fork 336
Description
Bug report
Describe the bug
QuPath uses a tile cache to speed up reading pixels.
Often, that's based on the path (or URI) for the image.
That's fine if the image doesn't change. But if a file exists on disk and is then overwritten after QuPath has been launched, attempting to read the new file can result in seeing pixels from the old file.
To Reproduce
Steps to reproduce the behavior:
- Find a small z-stack, e.g.
confocal-series.tiffrom the ImageJ samples - Open the image is QuPath and browse a few slices - but not all slices
- Open a different image in QuPath
- Open the original image in ImageJ and change it (e.g. Edit → Invert), then save with the same file name
- Open the original (but now modified) image in QuPath
- See that some slices have been cached, while others are not
Expected behavior
Some confusion is acceptable if the file is overwritten while the same image is open within QuPath's viewer.
But if the image is closed and then reopened, 'old' pixels shouldn't be returned from the cache.
Desktop (please complete the following information):
- OS: All
- QuPath Version: v0.6.0 (and probably all versions before)
Additional context
Probably relates to #1964 (comment)
An easy 'solution' would be to eagerly eject tiles from the cache. But when tile requests are expensive, this could unnecessarily harm performance.
An alternative could be to append the last modified time for a file to what is returned by ImageServer.getPath() - or some other property that should not change unless the file is modified (file size may work most of the timel, but isn't ideal since this may not changed for uncompressed TIFF even if the image has been modified).