snapdiff: Add filename column to HTML report
Basically, I want one cell that will always be present for turning the
cell green or red based on whether the images match or not.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
diff --git a/scripts/snapdiff.py b/scripts/snapdiff.py
index 53d9f82..291b2da 100755
--- a/scripts/snapdiff.py
+++ b/scripts/snapdiff.py
@@ -134,7 +134,6 @@
def find_images(prefix):
- prefix = os.path.abspath(prefix)
if os.path.isdir(prefix):
prefix_dir = prefix
else:
@@ -192,7 +191,7 @@
html.write('<html>\n')
html.write(' <body>\n')
html.write(' <table border="1">\n')
- html.write(' <tr><th>%s</th><th>%s</th><th>Δ</th></tr>\n' % (ref_prefix, src_prefix))
+ html.write(' <tr><th>File</th><th>%s</th><th>%s</th><th>Δ</th></tr>\n' % (ref_prefix, src_prefix))
for image in images:
ref_image = ref_prefix + image
src_image = src_prefix + image
@@ -208,6 +207,7 @@
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)