5 # Copyright (C) 2006 matteo.nastasi@milug.org
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details. You should have received a
16 # copy of the GNU General Public License along with this program; if
17 # not, write to the Free Software Foundation, Inc, 59 Temple Place -
18 # Suite 330, Boston, MA 02111-1307, USA.
23 OUTFILE=web/preload_img.js
24 IMGPATH=../brisk-img/img
28 # echo 'header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1'
29 # echo 'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past'
36 echo "var g_preload_img_arr = new Array( "
39 for i in `ls -S $IMGPATH/*.{jpg,png} | grep -v '/src_'`; do
40 if [ $first -ne 1 ]; then
42 if [ $ct -eq 4 ]; then
50 outna="img/`basename $i`"
60 echo "var g_preload_imgsz_arr = new Array( "
65 for i in `ls -S $IMGPATH`; do
66 sz="`stat -c '%s' $IMGPATH/$i`"
70 for i in `ls -S $IMGPATH`; do
71 if [ $first -ne 1 ]; then
73 if [ $ct -eq 8 ]; then
81 sz="`stat -c '%s' $IMGPATH/$i`"
83 cur="`echo "100.0 * $sum / $tot" | bc -l | sed 's/\(\.[0-9]\)[0-9]*/\1/g'`"