def image_mime_type(data):
 kind = _imghdr_what_wrapper(data)
 if (kind in ['gif', 'jpeg', 'png', 'tiff', 'bmp']):
  return 'image/{0}'.format(kind)
 elif (kind == 'pgm'):
  return 'image/x-portable-graymap'
 elif (kind == 'pbm'):
  return 'image/x-portable-bitmap'
 elif (kind == 'ppm'):
  return 'image/x-portable-pixmap'
 elif (kind == 'xbm'):
  return 'image/x-xbitmap'
 else:
  return 'image/x-{0}'.format(kind)

def image_mime_type ( data ) : kind = _imghdr_what_wrapper ( data ) if ( kind in [ 'gif' , 'jpeg' , 'png' , 'tiff' , 'bmp' ] ) : return 'image/{0}' . format ( kind ) elif ( kind == 'pgm' ) : return 'image/x-portable-graymap' elif ( kind == 'pbm' ) : return 'image/x-portable-bitmap' elif ( kind == 'ppm' ) : return 'image/x-portable-pixmap' elif ( kind == 'xbm' ) : return 'image/x-xbitmap' else : return 'image/x-{0}' . format ( kind )
return the mime type of the image data .