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

Unified Diff: gm/rebaseline_server/imagediffdb.py

Issue 471033003: Fixing broken images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed overly long lines 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') | no next file with comments »
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..8142445e910df4ea97f569a2e0f2bfd8c6acc146 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
@@ -212,9 +217,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698