summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2015-06-09 10:27:52 -0700
committerNanley Chery <nanley.g.chery@intel.com>2015-06-09 10:29:09 -0700
commit71502b9bab14f784c93f3350ce390ccf06c2cc3b (patch)
treec7ff03ce6f18c5fd27e2301ba55b400386b45801
parentbedee7dd5a3f7170f947ea628c692d9380d6d4dc (diff)
test more general file types
-rwxr-xr-xmake_ktxes.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/make_ktxes.sh b/make_ktxes.sh
index ab79444..c967d9a 100755
--- a/make_ktxes.sh
+++ b/make_ktxes.sh
@@ -122,6 +122,7 @@ decompressed_dir=../decompressed
# Input-based variables
inFileHead=${1%%.*}
+inFileExt=${1##$inFileHead}
img_w=`identify -format "%[fx:w]" $1`
img_h=`identify -format "%[fx:h]" $1`
format=${2}
@@ -173,7 +174,7 @@ function create_ktx_for_fmt {
for lod in $(seq 0 $MAX_LEVEL); do
# Choose the right base file
- inFile=${inFileHead}-${lod}.png
+ inFile=${inFileHead}-${lod}$inFileExt
# Setup output files
outFile=${outFileHead}-$lod
@@ -237,7 +238,8 @@ function create_ktx_for_fmt {
for lod in $(seq 0 $MAX_LEVEL); do
# Resize the image for current level of detail (LOD).
- convert -define png:preserve-colormap=true ${inFileHead}.png"[${img_w}x${img_h}!]" ${inFileHead}-${lod}.png
+ lod_out=${inFileHead}-${lod}$inFileExt
+ convert -define png:preserve-colormap=true -alpha set ${inFileHead}$inFileExt"[${img_w}x${img_h}!]" $lod_out
echo "LOD-$lod dimensions are: ${img_w}x${img_h}"
# Stop generating miplevels when reaching dimensions 1x1.
@@ -264,5 +266,5 @@ fi
# Delete each level of detail
for lod in $(seq 0 $MAX_LEVEL); do
- rm ${inFileHead}-${lod}.png
+ rm ${inFileHead}-${lod}$inFileExt
done