Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Unified Diff: gm/rebaseline_server/imagediffdb.py

Issue 471033003: Fixing broken images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/rebaseline_server/imagepair_test.py » ('j') | gm/rebaseline_server/imagepair_test.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/imagediffdb.py
diff --git a/gm/rebaseline_server/imagediffdb.py b/gm/rebaseline_server/imagediffdb.py
index 3c5f45f60f846aaaa99a9a9316b68a2faac2e663..06d57dab8c4ff31dfeddf8d8307d97cc896b9f0e 100644
--- a/gm/rebaseline_server/imagediffdb.py
+++ b/gm/rebaseline_server/imagediffdb.py
@@ -50,6 +50,8 @@ KEY__DIFFERENCES__MAX_DIFF_PER_CHANNEL = 'maxDiffPerChannel'
KEY__DIFFERENCES__NUM_DIFF_PIXELS = 'numDifferingPixels'
KEY__DIFFERENCES__PERCENT_DIFF_PIXELS = 'percentDifferingPixels'
KEY__DIFFERENCES__PERCEPTUAL_DIFF = 'perceptualDifference'
+KEY__DIFFERENCES__DIFF_URL = 'diffUrl'
+KEY__DIFFERENCES__WHITE_DIFF_URL = 'whiteDiffUrl'
# Special values within ImageDiffDB._diff_dict
_DIFFRECORD_FAILED = 'failed'
@@ -158,6 +160,9 @@ class DiffRecord(object):
record = data['records'][0]
self._width = record['width']
self._height = record['height']
+ self._diffUrl = os.path.split(record['rgbDiffPath'])[1]
+ self._whiteDiffUrl = os.path.split(record['whiteDiffPath'])[1]
+
# TODO: make max_diff_per_channel a tuple instead of a list, because the
# structure is meaningful (first element is red, second is green, etc.)
# See http://stackoverflow.com/a/626871
@@ -179,6 +184,10 @@ class DiffRecord(object):
if not 0 <= perceptual_similarity <= 1:
perceptual_similarity = 0
self._perceptual_difference = 100 - (perceptual_similarity * 100)
+ except:
+ print "expected:", expected_image_file
+ print "actual :", actual_image_file
+ raise
finally:
shutil.rmtree(skpdiff_output_dir)
@@ -212,9 +221,12 @@ class DiffRecord(object):
self.get_percent_pixels_differing(),
KEY__DIFFERENCES__MAX_DIFF_PER_CHANNEL: self._max_diff_per_channel,
KEY__DIFFERENCES__PERCEPTUAL_DIFF: self._perceptual_difference,
+ KEY__DIFFERENCES__DIFF_URL: self._diffUrl,
+ KEY__DIFFERENCES__WHITE_DIFF_URL: self._whiteDiffUrl,
}
+
class ImageDiffDB(object):
""" Calculates differences between image pairs, maintaining a database of
them for download."""
« no previous file with comments | « no previous file | gm/rebaseline_server/imagepair_test.py » ('j') | gm/rebaseline_server/imagepair_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698