From b92d166c6059368f19ace17debd25f802ed26ae1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 29 Dec 2016 16:07:31 +0100 Subject: [PATCH] add hacky script to losslessly compress pk3s using flif and squashfs. --- compress_pk3.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 compress_pk3.sh diff --git a/compress_pk3.sh b/compress_pk3.sh new file mode 100755 index 00000000..8ef719ab --- /dev/null +++ b/compress_pk3.sh @@ -0,0 +1,19 @@ +#!/bin/bash +inputPk3 = $1 + +echo "Extracting" +unzip -d extractDir $1 +cd extractDir + +echo "Converting" +for file in `find . | grep "\.tga"`; do # in theory we could make this parallel + convert ${file} "${file%.tga}.png" # tga -> png + $FLIF -e "${file%.tga}.png" "${file%.tga}.flif" # png -> flif + rm $file # rm tga + rm ${file%.tga}.png # rm png +done + +echo "Compressing" +mksquashfs * ../${1}.sqfs -comp xz -Xdict-size "100%" +cd .. # clean up +rm -r extractDir -- 2.39.2