summaryrefslogtreecommitdiffstats
path: root/chromium/tools/site_compare/operators/equals.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/tools/site_compare/operators/equals.py')
-rw-r--r--chromium/tools/site_compare/operators/equals.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/chromium/tools/site_compare/operators/equals.py b/chromium/tools/site_compare/operators/equals.py
deleted file mode 100644
index 311f530a059..00000000000
--- a/chromium/tools/site_compare/operators/equals.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Compare two images for equality."""
-
-from PIL import Image
-from PIL import ImageChops
-
-
-def Compare(file1, file2, **kwargs):
- """Compares two images to see if they're identical.
-
- Args:
- file1: path to first image to compare
- file2: path to second image to compare
- kwargs: unused for this operator
-
- Returns:
- None if the images are identical
- A tuple of (errorstring, image) if they're not
- """
- kwargs = kwargs # unused parameter
-
- im1 = Image.open(file1)
- im2 = Image.open(file2)
-
- if im1.size != im2.size:
- return ("The images are of different size (%s vs %s)" %
- (im1.size, im2.size), im1)
-
- diff = ImageChops.difference(im1, im2)
-
- if max(diff.getextrema()) != (0, 0):
- return ("The images differ", diff)
- else:
- return None