Merge pull request #6840 from radarhere/ifd1

This commit is contained in:
Hugo van Kemenade 2022-12-29 23:38:09 +02:00 committed by GitHub
commit 9ae53cf6ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3687,7 +3687,7 @@ class Exif(MutableMapping):
def get_ifd(self, tag): def get_ifd(self, tag):
if tag not in self._ifds: if tag not in self._ifds:
if tag == ExifTags.IFD.IFD1: if tag == ExifTags.IFD.IFD1:
if self._info is not None: if self._info is not None and self._info.next != 0:
self._ifds[tag] = self._get_ifd_dict(self._info.next) self._ifds[tag] = self._get_ifd_dict(self._info.next)
elif tag in [ExifTags.IFD.Exif, ExifTags.IFD.GPSInfo]: elif tag in [ExifTags.IFD.Exif, ExifTags.IFD.GPSInfo]:
offset = self._hidden_data.get(tag, self.get(tag)) offset = self._hidden_data.get(tag, self.get(tag))