Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: tools/telemetry/telemetry/image_processing/image_util.py

Issue 865653004: Document and test that image_util.WritePngFile requires path end in 'png'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review feedback from sullivan. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/image_processing/image_util.py
diff --git a/tools/telemetry/telemetry/image_processing/image_util.py b/tools/telemetry/telemetry/image_processing/image_util.py
index 478661f5c98d82c2f321b07352df52cf46564734..3a141c98b05f3243c291430c133ad7a67aaad5e8 100644
--- a/tools/telemetry/telemetry/image_processing/image_util.py
+++ b/tools/telemetry/telemetry/image_processing/image_util.py
@@ -46,6 +46,13 @@ def GetPixelColor(image, x, y):
return impl.GetPixelColor(image, x, y)
def WritePngFile(image, path):
+ """Write an image to a PNG file.
+
+ Args:
+ image: an image object.
+ path: The path to the PNG file. Must end in 'png' or an
+ AssertionError will be raised."""
+ assert(path.endswith('png'))
return impl.WritePngFile(image, path)
def FromRGBPixels(width, height, pixels, bpp=3):

Powered by Google App Engine
This is Rietveld 408576698