mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-25 06:34:48 +03:00
py2 compatibility
This commit is contained in:
parent
49fc09d590
commit
60c5614086
|
@ -493,7 +493,7 @@ class ExifImageFileDirectory(TiffImagePlugin.ImageFileDirectory_v1):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def _setitem(self, tag, value, legacy_api):
|
def _setitem(self, tag, value, legacy_api):
|
||||||
super()._setitem(tag, value, legacy_api)
|
TiffImagePlugin.ImageFileDirectory_v1._setitem(self, tag, value, legacy_api)
|
||||||
if legacy_api:
|
if legacy_api:
|
||||||
val = self._tags_v1[tag]
|
val = self._tags_v1[tag]
|
||||||
if not isinstance(val, (tuple, bytes)):
|
if not isinstance(val, (tuple, bytes)):
|
||||||
|
@ -504,7 +504,7 @@ class ExifImageFileDirectory(TiffImagePlugin.ImageFileDirectory_v1):
|
||||||
if isinstance(value, TiffImagePlugin.ImageFileDirectory_v2):
|
if isinstance(value, TiffImagePlugin.ImageFileDirectory_v2):
|
||||||
self._tags_v1[tag] = value
|
self._tags_v1[tag] = value
|
||||||
else:
|
else:
|
||||||
super().__setitem__(tag, value)
|
TiffImagePlugin.ImageFileDirectory_v1.__setitem__(self, tag, value)
|
||||||
|
|
||||||
def __getitem__(self, tag):
|
def __getitem__(self, tag):
|
||||||
if tag not in self._tags_v1: # unpack on the fly
|
if tag not in self._tags_v1: # unpack on the fly
|
||||||
|
@ -526,7 +526,7 @@ class ExifImageFileDirectory(TiffImagePlugin.ImageFileDirectory_v1):
|
||||||
self._tagdata.update(other._tagdata)
|
self._tagdata.update(other._tagdata)
|
||||||
self.tagtype.update(other.tagtype)
|
self.tagtype.update(other.tagtype)
|
||||||
else:
|
else:
|
||||||
super().update(*args, **kwds)
|
TiffImagePlugin.ImageFileDirectory_v1.update(self, *args, **kwds)
|
||||||
|
|
||||||
|
|
||||||
def _getexif(self):
|
def _getexif(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user