diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-06-17 21:46:02 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-06-17 21:46:02 -0700 |
commit | 618eac34c8caa918b966deb051ffd0296f3bdcb1 (patch) | |
tree | e32e4c03a2414aadbcfe4a1ca612d69b77ca863c /tools/file_packager.py | |
parent | 93bf936628e0a277c9a6b0f916099399be4697e2 (diff) |
crunch fixes
Diffstat (limited to 'tools/file_packager.py')
-rw-r--r-- | tools/file_packager.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py index e71f6b22..0cef3bcb 100644 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -138,11 +138,12 @@ if crunch: for file_ in data_files: if file_['name'].endswith(CRUNCH_INPUT_SUFFIX): + # TODO: do not crunch if crunched version exists and is more recent than dds source Popen([CRUNCH, '-file', file_['name'], '-quality', crunch], stdout=sys.stderr).communicate() crunch_name = unsuffixed(file_['name']) + CRUNCH_OUTPUT_SUFFIX + shutil.move(os.path.basename(crunch_name), crunch_name) # crunch places files in the current dir # prepend the dds header crunched = open(crunch_name, 'rb').read() - shutil.move(crunch_name, crunch_name + '.save') c = open(crunch_name, 'wb') c.write(open(file_['name'], 'rb').read()[:DDS_HEADER_SIZE]) c.write(crunched) |