]> git.cworth.org Git - apitrace/commitdiff
snapdiff: Compare .bmp images too.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 13 Dec 2011 15:53:49 +0000 (15:53 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 13 Dec 2011 15:54:03 +0000 (15:54 +0000)
Quite common too.

scripts/snapdiff.py

index b7bad72336d0e06818c5e1315a7f381c385da7df..ddc2bf7bcc977b0c498e7c58524da976a5ee8835 100755 (executable)
@@ -121,10 +121,11 @@ def surface(html, image):
 
 
 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):