From: commit-bot@chromium.org Date: Wed, 26 Mar 2014 13:38:29 +0000 (+0000) Subject: rebaseline_server: delete invalid image files from local disk cache X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~8510 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da0ceb22995640c766a929369bf4b704fcd33418;p=platform%2Fupstream%2FlibSkiaSharp.git rebaseline_server: delete invalid image files from local disk cache BUG=skia:2247 NOTREECHECKS=True NOTRY=True R=borenet@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/211733004 git-svn-id: http://skia.googlecode.com/svn/trunk@13951 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/gm/rebaseline_server/imagediffdb.py b/gm/rebaseline_server/imagediffdb.py index a53eb1f..8328543 100644 --- a/gm/rebaseline_server/imagediffdb.py +++ b/gm/rebaseline_server/imagediffdb.py @@ -387,7 +387,10 @@ def _open_image(filepath): try: return Image.open(filepath) except IOError: - logging.error('IOError loading image file %s' % filepath) + # If we are unable to load an image from the file, delete it from disk + # and we will try to fetch it again next time. Fixes http://skbug.com/2247 + logging.error('IOError loading image file %s ; deleting it.' % filepath) + os.remove(filepath) raise