Use SRGBA for Mac on Python for image test

PiperOrigin-RevId: 577931014
This commit is contained in:
Sebastian Schmidt 2023-10-30 13:04:17 -07:00 committed by Copybara-Service
parent 7256bd2638
commit ec032fb018

View File

@ -207,10 +207,12 @@ class ImageTest(absltest.TestCase):
loaded_image = Image.create_from_file(image_path) loaded_image = Image.create_from_file(image_path)
self.assertEqual(loaded_image.width, 720) self.assertEqual(loaded_image.width, 720)
self.assertEqual(loaded_image.height, 382) self.assertEqual(loaded_image.height, 382)
# On Mac w/ GPU support, images use 4 channels. Otherwise, all images use # On Mac w/ GPU support, images use 4 channels (SRGBA). Otherwise, all
# 3 channels. # images use 3 channels (SRGB).
self.assertIn(loaded_image.channels, [3, 4]) self.assertIn(loaded_image.channels, [3, 4])
self.assertEqual(loaded_image.image_format, ImageFormat.SRGB) self.assertIn(
loaded_image.image_format, [ImageFormat.SRGB, ImageFormat.SRGBA]
)
if __name__ == '__main__': if __name__ == '__main__':
absltest.main() absltest.main()