Permalink
Browse files

Restore resources optimization script

  • Loading branch information...
eelco committed Nov 22, 2016
1 parent f8391b4 commit 9d8b135d11f1fa57c38df3ff1712a89d157a3d22
Showing with 6 additions and 6 deletions.
  1. +6 −6 scripts/resources-optimize.py
@@ -10,17 +10,17 @@
"""
path = os.path.join("extras", "resources.framerjs.com", "static", "DeviceResources")
-jp2_quality = 100
+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.system("rm -Rf '%s'" % path)
+os.system("cp -Rf '%s' '%s'" % (os.path.join("extras", "DeviceResources"), path))
os.chdir(path)
for fileName in os.listdir("."):
- if fileName.startswith("apple-watch") and fileName.endswith(".png"):
+ 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 '%s'" % fileName)
+ os.system("cwebp -q %s '%s' -o '%s'" % (webp_quality, fileName, fileName.replace(".png", ".webp")))
+ os.system("optipng '%s'" % fileName)

0 comments on commit 9d8b135

Please sign in to comment.