def get_value(self, tag_name, default=None, human=False):
        """ Return the value of IFD entry with given tag name.

        When the entry does not exist, return default.
        """
        entry = self.get(tag_name)
        if entry is not None:
            value = entry.value
        else:
            if default is None:
                if default_tag_values.has_key(tag_name):
                    value = default_tag_values[tag_name]
                else:
                    value = None
                    sys.stdout.write ('%s.get_value: no default value defined tiff_data.default_tag_values dict for %r IFD tag\n' % (self.__class__.__name__, tag_name))
            else:
                value = default
        if tag_name in ['StripOffsets', 'StripByteCounts']:
            if not isinstance (value, numpy.ndarray):
                value = numpy.array([value])                
        if tag_name in ['BitsPerSample', 'SampleFormat']:
            samples_per_pixel = self.get_value ('SamplesPerPixel')
            if not isinstance (value, numpy.ndarray):
                value = numpy.array([value]*samples_per_pixel)
            if tag_name in ['BitsPerSample']:
                value = value[:samples_per_pixel]
        if tag_name in ['ImageDescription', 'Software', 'Copyright', 'DocumentName', 'Model', 'Make', 'PageName',
                        'DateTime', 'Artist', 'HostComputer']:
            if value is not None:
                return ''.join(value.view('|S%s' % (value.nbytes//value.size)))
        if human:
            if tag_name=='Compression':
                value = {1:'Uncompressed', 2:'CCITT1D', 3:'Group3Fax', 4:'Group4Fax',
                         5:'LZW', 6:'JPEG', 32773:'PackBits'}.get (value, value)
            elif tag_name=='Predictor':
                value = {1: 'None', 2: 'HorizontalDifferencing'}.get (value,value)
            elif tag_name=='PhotometricInterpretation':
                value = {0:'WhiteIsZero', 1:'BlackIsZero', 2:'RGB',3:'RGBPalette',
                         4:'TransparencyMask', 5:'CMYK', 6:'YCbCr', 8:'CIELab'}.get (value, value)
            elif tag_name=='PlanarConfiguration':
                value = {1:'Chunky', 2:'Planar'}.get (value, value)
            elif tag_name=='Orientation':
                value = {1:'TopLeft',2:'TopRight', 3:'BottomRight', 4:'BottomLeft',
                         5:'LeftTop', 6:'RightTop', 7:'RightBottom', 8:'LeftBottom'}.get (value, value)
            elif tag_name=='SampleFormat':
                new_value = []
                for v in value:
                    new_value.append(type2name.get (v, v))
                value = new_value
            elif tag_name=='ResolutionUnit':
                value = {1: 'Arbitrary', 2: 'Inch', 3: 'Centimeter'}.get (value, value)
            elif tag_name=='FillOrder':
                pass
        return value
dataset/ETHPy150Open pearu/pylibtiff/libtiff/tiff_file.py/IFD.get_value/original