def _read_metadata(self):
        """Read metadata for current frame and return as dict"""
        try:
            tags = self.im.tag_v2  # for Pillow >= v3.0.0
        except AttributeError:
            tags = self.im.tag  # for Pillow < v3.0.0
        md = {}
        try:
            md["ImageDescription"] = tags[270]
        except __HOLE__:
            pass
        try:
            md["DateTime"] = _tiff_datetime(tags[306])
        except KeyError:
            pass
        try:
            md["Software"] = tags[305]
        except KeyError:
            pass
        try:
            md["DocumentName"] = tags[269]
        except KeyError:
            pass
        return md
dataset/ETHPy150Open soft-matter/pims/pims/tiff_stack.py/TiffStack_pil._read_metadata