Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from aarmea/master

Slightly friendlier to use on Windows
  • Loading branch information...
commit 7a87e13b1736c1f6440571b2825343b500c43139 2 parents ca86866 + c6f596f
@sublimehq authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 anim_encoder.py
View
10 anim_encoder.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2012, Sublime HQ Pty Ltd
# All rights reserved.
@@ -196,8 +196,12 @@ def generate_animation(anim_name):
packed = packed[0:allocator.num_used_rows]
misc.imsave(anim_name + "_packed_tmp.png", packed)
- os.system("pngcrush -q " + anim_name + "_packed_tmp.png " + anim_name + "_packed.png")
- os.system("rm " + anim_name + "_packed_tmp.png")
+ # Don't completely fail if we don't have pngcrush
+ if os.system("pngcrush -q " + anim_name + "_packed_tmp.png " + anim_name + "_packed.png") == 0:
+ os.system("rm " + anim_name + "_packed_tmp.png")
+ else:
+ print "pngcrush not found, output will not be larger"
+ os.system("mv " + anim_name + "_packed_tmp.png " + anim_name + "_packed.png")
# Generate JSON to represent the data
times = [t for t, f in frames]
Please sign in to comment.
Something went wrong with that request. Please try again.