]> git.cworth.org Git - apitrace/blobdiff - scripts/snapdiff.py
snapdiff: Add filename column to HTML report
[apitrace] / scripts / snapdiff.py
index bf3768646acfceb1e296ebb431e5ab97346ad8cf..291b2da9425d71e4e075bec9d66fb049fd018daa 100755 (executable)
@@ -130,12 +130,10 @@ def is_image(path):
     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):
-    prefix = os.path.abspath(prefix)
     if os.path.isdir(prefix):
         prefix_dir = prefix
     else:
@@ -193,7 +191,7 @@ def main():
     html.write('<html>\n')
     html.write('  <body>\n')
     html.write('    <table border="1">\n')
-    html.write('      <tr><th>%s</th><th>%s</th><th>&Delta;</th></tr>\n' % (ref_prefix, src_prefix))
+    html.write('      <tr><th>File</th><th>%s</th><th>%s</th><th>&Delta;</th></tr>\n' % (ref_prefix, src_prefix))
     for image in images:
         ref_image = ref_prefix + image
         src_image = src_prefix + image
@@ -209,6 +207,7 @@ def main():
                 comparer.write_diff(delta_image, fuzz=options.fuzz)
 
             html.write('      <tr>\n')
+            html.write('        <td>%s</td>\n' % (image,))
             surface(html, ref_image)
             surface(html, src_image)
             surface(html, delta_image)