Crop images to desired dimensions before comparison.
Images contain a text label showing the time at which the video was sampled.
This was left to assist later analysis. However, it takes a dependency on
text rendering that changes and breaks the tests.
We are cropping the images to exclude this label when doing a local RGB
comparison. If the comparison is successful then we return, if it is not
then we upload to bp as before.
** Together with this change, force images collected to be RGB.
BUG=chromium:393684
TEST=Ran local test. Should get more coverage from lab.
Change-Id: Ia95679066fc44a3970ff014cee1c113b032a1145
Reviewed-on: https://chromium-review.googlesource.com/212190
Reviewed-by: Rohit Makasana <rohitbm@chromium.org>
Commit-Queue: Mussa Kiroga <mussa@chromium.org>
Tested-by: Mussa Kiroga <mussa@chromium.org>
diff --git a/client/common_lib/site_utils.py b/client/common_lib/site_utils.py
index 8f44a9e..ebf0efe 100644
--- a/client/common_lib/site_utils.py
+++ b/client/common_lib/site_utils.py
@@ -367,7 +367,7 @@
params = {'height': final_height, 'x_offset': x_offset_pixels,
'y_offset': y_offset_pixels, 'path': fullpath}
- import_cmd = ('/usr/local/bin/import -window root -depth 8 -crop '
+ import_cmd = ('/usr/local/bin/import -window root -depth 8 -colorspace RGB -crop '
'x%(height)d+%(x_offset)d+%(y_offset)d %(path)s' % params)
_execute_screenshot_capture_command(import_cmd)