Compare absolute path of filename

This commit is contained in:
Andrew Murray 2025-04-02 12:16:25 +11:00
parent 1103e82d17
commit 8dbbce624f

View File

@ -2543,7 +2543,9 @@ class Image:
from . import ImageFile
# may mutate self!
if isinstance(self, ImageFile.ImageFile) and filename == self.filename:
if isinstance(self, ImageFile.ImageFile) and os.path.abspath(
filename
) == os.path.abspath(self.filename):
self._ensure_mutable()
else:
self.load()