Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't fail if pngcrush is not found

If pngcrush is not installed, don't delete the packed file and
output it without compressing with pngcrush.
  • Loading branch information...
commit c6f596fd90bf132f82a7cd3e98783f87ff967f1c 1 parent 9d483a4
@aarmea aarmea authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 anim_encoder.py
View
8 anim_encoder.py
@@ -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"

I assume the word "not" is supposed to be "now"?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ 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.