Open radarhere opened 1 month ago
What about TiffImagePlugin? Can we call super().seek() there?
What about TiffImagePlugin? Can we call super().seek() there?
No, because at the end of TiffImagePlugin's seek()
, the normal size isn't used - self._tile_size
is.
Addresses #8439
8390 stopped
load_prepare()
from recreating the core image instance if the mode or size had changed, as might happen at the end of aseek()
operation. After that PR, this was no longer needed for any of our internal plugins.However, #8439 has pointed out that this would still be helpful for external plugins. Rather than reverting the change, this PR suggests that external plugins can call
super().seek()
at the end of theirseek()
methods. That will then clear the core image instance if the mode or size has changed, allowingload_prepare()
to detect that a new core image is needed.The advantage of this over a simple revert is that if a user calls
seek()
on an image, but notload()
, then the core image instance is discarded.