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

Side by Side Diff: tools/site_compare/operators/equals.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python2.4 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 3 # found in the LICENSE file.
5 4
6 """Compare two images for equality.""" 5 """Compare two images for equality."""
7 6
8 from PIL import Image 7 from PIL import Image
9 from PIL import ImageChops 8 from PIL import ImageChops
10 9
11 10
12 def Compare(file1, file2, **kwargs): 11 def Compare(file1, file2, **kwargs):
(...skipping 16 matching lines...) Expand all
29 if im1.size != im2.size: 28 if im1.size != im2.size:
30 return ("The images are of different size (%s vs %s)" % 29 return ("The images are of different size (%s vs %s)" %
31 (im1.size, im2.size), im1) 30 (im1.size, im2.size), im1)
32 31
33 diff = ImageChops.difference(im1, im2) 32 diff = ImageChops.difference(im1, im2)
34 33
35 if max(diff.getextrema()) != (0, 0): 34 if max(diff.getextrema()) != (0, 0):
36 return ("The images differ", diff) 35 return ("The images differ", diff)
37 else: 36 else:
38 return None 37 return None
39
40
41
OLDNEW
« no previous file with comments | « tools/site_compare/operators/__init__.py ('k') | tools/site_compare/operators/equals_with_mask.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698