docs: def get_dimensions(filenames):
      """given a sequence of filenames, compute dimensions
      return sequence of tuples (x, y, content-type, filename)"""
  
      dims = []
      for filename in filenames:
          implemented = False
          with open(filename, 'rb') as fp:
  
              img_types = (PNGFile, GIFFile, JPEGFile)
              for img_type in img_types:
                  sig = str(getattr(img_type, 'SIGNATURE')[0])
                  magic = fp.read(len(sig))
                  fp.seek(0)
                  if magic == sig:
                      cls = img_type.__name__.split('.')[-1]
                      img = getattr(img_type, cls)(fp)
                      x, y = img.size
                      dims.append((x, y, img.content_type, filename))
                      implemented = True
                      break
              if not implemented:
                  # might want to fail silently, or print error to stdout...
                  print('cannot handle file: %s' % filename)
                  raise NotImplementedError
      return dims