summaryrefslogblamecommitdiff
path: root/src/bin/edje/edje_recc
blob: 2ae81ad2777244d6a408fa1f7d41fdbf623538d7 (plain) (tree)
1
2
3
4
5
6
7



         

               
                                                   






                                                                                

                                                                                      
         












                     
 


             
 


             
 
            

             
 







                     
                                           

         

  
                
                    
                 
         




            
               


               
#!/bin/sh

set -e

usage () {
  echo "Usage:"
  echo "        edje_recc [OPTIONS] input_file.edj"
  echo ""
  echo "Where OPTIONS is one or more of:"
  echo ""
  echo "-v                       Verbose output"
  echo "-no-lossy                Do NOT allow images to be lossy"
  echo "-no-comp                 Do NOT allow images to be lossless compression"
  echo "-no-raw                  Do NOT allow images to be zero compression"
  echo "-min-quality VAL         Do NOT allow lossy images with quality < VAL (0-100)"
  echo "-max-quality VAL         Do NOT allow lossy images with quality > VAL (0-100)"
  exit -1
}

if [ $# -lt 1 ]; then
  usage
fi

OPT=""
if [ $# -ge 1 ]; then
  for I in $@; do
    case "$I" in
      -h)
        usage
      ;;

      -help)
        usage
      ;;

      --help)
        usage
      ;;

      *.edj)
        IN=$I
      ;;

      *)
        OPT=$OPT" "$I
      ;;
    esac
  done
fi

if [ -z "$IN" ]; then
  echo "ERROR: NO input file.edj provided!"
  echo ""
  usage;
fi

F=`basename $IN`
B=`basename $F .edj`
T="./...edje_tmp"
rm -rf $T
mkdir -p $T
cp $IN $T
cd $T
edje_decc $F
cd $B
./build.sh $OPT
cd ../..
mv $T/$B/$F $IN
rm -rf $T