Commit b4fba487 authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

Android: Don't convert star_gray.png to webp.

Decoding crashes on Samsung Galaxy S5 devices running L (potentially
due bugs in the system libs).

Bug: 807059
Change-Id: Iab24378247c3f8c460d54a6515d75f0e1396999c
Reviewed-on: https://chromium-review.googlesource.com/919319
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537216}
parent 3de50d0e
......@@ -107,6 +107,16 @@ _DENSITY_SPLITS = {
),
}
# Pngs that we shouldn't convert to webp. Please add rationale when updating.
_PNG_WEBP_BLACKLIST_PATTERN = re.compile('|'.join([
# Crashes on Galaxy S5 running L (https://crbug.com/807059).
r'.*star_gray\.png',
# Android requires pngs for 9-patch images.
r'.*\.9\.png',
# Daydream (*.dd) requires pngs for icon files.
r'.*\.dd\.png']))
class _ResourceWhitelist(object):
def __init__(self, entries=None):
self._entries = None
......@@ -698,10 +708,9 @@ def _ConvertToWebP(webp_binary, png_files):
'-lossless', '-o', webp_path]
subprocess.check_call(args)
os.remove(png_path)
# Android requires pngs for 9-patch images.
# Daydream (*.dd) requires pngs for icon files.
pool.map(convert_image, [f for f in png_files if not (f.endswith('.9.png') or
f.endswith('.dd.png'))])
pool.map(convert_image, [f for f in png_files
if not _PNG_WEBP_BLACKLIST_PATTERN.match(f)])
pool.close()
pool.join()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment