def is_image(path):
- return \
- path.endswith('.png') \
- and not path.endswith('.diff.png') \
- and not path.endswith('.thumb.png')
+ name = os.path.basename(path)
+ name, ext1 = os.path.splitext(name)
+ name, ext2 = os.path.splitext(name)
+ print name, ext1, ext2
+ return ext1 in ('.png', '.bmp') and ext2 not in ('.diff', '.thumb')
def find_images(prefix):
'-f', '--fuzz',
type="float", dest="fuzz", default=0.05,
help="fuzz ratio [default: %default]")
+ optparser.add_option(
+ '-a', '--alpha',
+ action="store_true", dest="alpha", default=False,
+ help="take alpha channel in consideration")
optparser.add_option(
'--overwrite',
action="store_true", dest="overwrite", default=False,
- help="overwrite")
+ help="overwrite images")
(options, args) = optparser.parse_args(sys.argv[1:])
or (os.path.getmtime(delta_image) < os.path.getmtime(ref_image) \
and os.path.getmtime(delta_image) < os.path.getmtime(src_image)):
- comparer = Comparer(ref_image, src_image)
+ comparer = Comparer(ref_image, src_image, options.alpha)
comparer.write_diff(delta_image, fuzz=options.fuzz)
html.write(' <tr>\n')