Handle different image sizes correctly.
This commit is contained in:
parent
adc8f9df1b
commit
8b0b9ed5fe
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
import math, operator
|
||||
#import math, operator
|
||||
import Image
|
||||
import sys
|
||||
|
||||
|
@ -27,6 +27,10 @@ def compare(fn1, fn2):
|
|||
return -1
|
||||
diff = 0
|
||||
pixels = im1.size[0] * im1.size[1]
|
||||
delta_pixels = im2.size[0] * im2.size[1] - pixels
|
||||
if delta_pixels != 0:
|
||||
errors.append((fn1, delta_pixels))
|
||||
return delta_pixels
|
||||
im1 = im1.getdata()
|
||||
im2 = im2.getdata()
|
||||
for i in range(3, pixels - 1, 3):
|
||||
|
|
Loading…
Reference in a new issue