continue extraction zip

parent 7209e37b
#!/bin/sh
BASEDIR=$1
OUTDIR=$2
count=1
ext=.jpg
cd $BASEDIR
for f in $(find . -type f -name '*.zip')
do
file=$f"/"
filename=$OUTDIR"/T"$(echo $f | cut -d"T" -f2-10 | cut -d"." -f1)"_B"
if [ ! -e $filename"02.jp2" || ! -e $filename"03.jp2" || ! -e $filename"04.jp2" ]; then
unzip -j $f *B02.jp2 *B03.jp2 *B04.jp2 -d $OUTDIR
else
echo PASS $f
fi
cd $OUTDIR
red=$(ls *B04.jp2 -t |head -1)
green=$(ls *B03.jp2 -t |head -1)
blue=$(ls *B02.jp2 -t |head -1)
# m=$(pwd)
# red=$m/$red
# green=$m/$green
# blue=$m/$blue
# ./jp2ToJPGandStretch $red
# ./jp2ToJPGandStretch $green
# ./jp2ToJPGandStretch $blue
# red=$(ls *B04.jpg -t |head -1)
# green=$(ls *B03.jpg -t |head -1)
# blue=$(ls *B02.jpg -t |head -1)
# m=$(pwd)
# red=$m/$red
# green=$m/$green
# blue=$m/$blue
# convert $red $green $blue -combine $(OUTDIR)/$count$ext
# rm *.jp2
# rm *B04.jpg
# rm *B03.jpg
# rm *B02.jpg
# count=$((count+1))
cd ..
done
......@@ -7,7 +7,14 @@ ext=.jpg
cd $BASEDIR
for f in $(find . -type f -name '*.zip')
do
unzip -j $f *B02.jp2 *B03.jp2 *B04.jp2 -d $OUTDIR
filename=$OUTDIR"/T"$(echo $f | cut -d"T" -f2-10 | cut -d"." -f1)"_B"
if [ ! -e $filename"02.jp2" || ! -e $filename"03.jp2" || ! -e $filename"04.jp2" ]; then
unzip -j $f *B02.jp2 *B03.jp2 *B04.jp2 -d $OUTDIR
else
echo PASS $f
fi
cd $OUTDIR
red=$(ls *B04.jp2 -t |head -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment