def testPNGEncodeDecode(self):
     self.assertTrue(
         _AllPixelsOfColor(
             image_tools.DecodePNG(image_tools.EncodePNG(self.white25)),
             (255, 255, 255, 255)))
     self.assertTrue(
         _AllPixelsOfColor(
             image_tools.DecodePNG(image_tools.EncodePNG(self.black25)),
             (0, 0, 0, 255)))
Exemplo n.º 2
0
  def DownloadImage(self, full_path):
    """Downloads an image from a location in GS.

    Args:
      full_path: the path to the file in GS including the file extension.

    Returns:
      The downloaded RGB PIL.Image.

    Raises:
      cloud_bucket.NotFoundError: if the path to the image is not valid.
    """
    return image_tools.DecodePNG(self.cloud_bucket.DownloadFile(full_path))