|
From: Yohann C. <pl...@us...> - 2004-11-17 21:48:33
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv836 Added Files: jpgbmp Log Message: conversion des jpg et tga en bmp --- NEW FILE: jpgbmp --- #!/bin/bash function explore() { TERMWIDTH=$COLUMNS file=`echo $1 | sed -e "s/\/$//"` let as=$(echo $file | wc -c) let fillsize=$(( ($TERMWIDTH - $as) /2 )) fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " let fillsize=${fillsize}-1 done line="" let fillsize=$TERMWIDTH while [ "$fillsize" -gt "0" ] do line="${line}=" let fillsize=${fillsize}-1 done echo $line echo "$fill$file" echo $line for FICHIER in $file/* do if test -d $FICHIER then explore $FICHIER fi done for ENTREE in $file/*.jpg do if [ -e ./$ENTREE ]; then affiche=" --- `basename $ENTREE`" SORTIE=$(echo $ENTREE | sed -e s/jpg/bmp/) if [ ! -e $SORTIE ]; then convert $ENTREE $SORTIE if [ -e $SORTIE ]; then result="[OK]" else result="[FAILED]" fi else result="[PASS]" fi let affichesize=$(echo $affiche | wc -c) let resultsize=$(echo $result | wc -c) let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " let fillsize=${fillsize}-1 done echo "$affiche$fill$result" fi done for ENTREE in $file/*.tga do if [ -e ./$ENTREE ]; then affiche=" --- `basename $ENTREE`" SORTIE=$(echo $ENTREE | sed -e s/tga/bmp/) if [ ! -e $SORTIE ]; then convert $ENTREE $SORTIE if [ -e $SORTIE ]; then result="[OK]" else result="[FAILED]" fi else result="[PASS]" fi let affichesize=$(echo $affiche | wc -c) let resultsize=$(echo $result | wc -c) let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " let fillsize=${fillsize}-1 done echo "$affiche$fill$result" fi done } explore $1 |