Permalink
Browse files

Better device resources

  • Loading branch information...
koenbok committed Jul 27, 2016
1 parent f74b3cb commit 27d2d35813f982a4c165badc9e96376bec75f271
Showing with 7 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +0 −1 extras/resources.framerjs.com/static/DeviceResources
  3. +6 −4 scripts/resources-optimize.py
@@ -55,3 +55,4 @@ _projects
# Ed
.idea
Icon
/extras/resources.framerjs.com/static/DeviceResources

This file was deleted.

Oops, something went wrong.
@@ -4,21 +4,23 @@
"""
brew install imagemagick --with-jp2
brew install optipng
brew install webp
"""
path = os.path.join("extras", "DeviceResources")
path = os.path.join("extras", "resources.framerjs.com", "static", "DeviceResources")
jp2_quality = 16
webp_quality = 90
os.system("rm -Rf '%s'" % path)
os.system("cp -Rf '%s' '%s'" % (os.path.join("extras", "DeviceResources"), path))
os.chdir(path)
os.system("rm *.jp2")
os.system("rm *.webp")
for fileName in os.listdir("."):
if fileName.endswith(".png"):
print fileName
os.system("sips -s format jp2 %s -s formatOptions %s --out %s" % (fileName, jp2_quality, fileName.replace(".png", ".jp2")))
os.system("cwebp -q %s '%s' -o '%s'" % (webp_quality, fileName, fileName.replace(".png", ".webp")))
os.system("optipng -o4 '%s'" % fileName)

0 comments on commit 27d2d35

Please sign in to comment.