File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/python
1+ #!/usr/bin/env python
22# Copyright (c) 2012, Sublime HQ Pty Ltd
33# All rights reserved.
44
@@ -196,8 +196,12 @@ def generate_animation(anim_name):
196196 packed = packed [0 :allocator .num_used_rows ]
197197
198198 misc .imsave (anim_name + "_packed_tmp.png" , packed )
199- os .system ("pngcrush -q " + anim_name + "_packed_tmp.png " + anim_name + "_packed.png" )
200- os .system ("rm " + anim_name + "_packed_tmp.png" )
199+ # Don't completely fail if we don't have pngcrush
200+ if os .system ("pngcrush -q " + anim_name + "_packed_tmp.png " + anim_name + "_packed.png" ) == 0 :
201+ os .system ("rm " + anim_name + "_packed_tmp.png" )
202+ else :
203+ print "pngcrush not found, output will not be larger"
204+ os .system ("mv " + anim_name + "_packed_tmp.png " + anim_name + "_packed.png" )
201205
202206 # Generate JSON to represent the data
203207 times = [t for t , f in frames ]
You can’t perform that action at this time.
0 commit comments