Skip to content

Commit

Permalink
Restore resources optimization script
Browse files Browse the repository at this point in the history
  • Loading branch information
eelco committed Nov 22, 2016
1 parent f8391b4 commit 9d8b135
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/resources-optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.