# make the url nice and clean; the comments shows an url that should be matched
-# web_base/tag/me+berlin/pic/id
+# web_base/tag/me+berlin/pic/id
RewriteRule tag/([-_\s,a-zA-Z0-9+]*)/pic/([0-9]*) index.php?tag=$1&pic=$2 [L]
-# web_base/tag/tag1+tag2/page/4
+# web_base/tag/tag1+tag2/page/4
RewriteRule tag/([-_\s,a-zA-Z0-9+]*)/page/([0-9]*) index.php?tag=$1&page=$2 [L]
# web_base/tag/tag1+tag2
# web_base/pic/17
RewriteRule pic/([0-9]*) index.php?pic=$1 [L]
-# web_base/page/4
+# web_base/page/4
RewriteRule page/([0-9]*) index.php?page=$1 [L]
</IfModule>
# init some variables
removemeta=0
-# parse ini file
+# parse ini file
CONFIG_FILE="config.ini"
# copied and modified from http://mark.aufflick.com/blog/2007/11/08/parsing-ini-files-with-sed
echo "skipping $offset pics, getting 50 new pics to work on..."
# handle white space in filename correctly
FILES=`$NICE sqlite3 $LOCALDB "select replace(base_uri||'/'||filename,' ','%20') from photos limit $offset,100"`
-
+
if [ "x$FILES" != "x" ] ; then
#found some files, process them
for file in $FILES; do
file=${file//\%20/ }
dir=`dirname "$file"`
base=`basename "$file"`
-
+
if [ ! -s "Photos-tiny/$dir/$base" ] ; then
mkdir -p Photos-tiny/$dir
$NICE convert "$dirprefix/$file" -auto-orient -resize x100 -quality 80% "Photos-tiny/$dir/$base"
$NICE jhead -q -se -cl "This photo belongs to $admin and was taken from $webbase. If you want to use this photo, please contact him." "Photos-tiny/$dir/$base"
fi
done=$((done+1))
- fi
+ fi
if [ ! -s "Photos-small/$dir/$base" ] ; then
mkdir -p Photos-small/$dir
$NICE convert "$dirprefix/$file" -auto-orient -resize x600 -quality 80% "Photos-small/$dir/$base"
$NICE jhead -q -se -cl "This photo belongs to $admin and was taken from $webbase. If you want to use this photo, please contact him." "Photos-small/$dir/$base"
fi
done=$((done+1))
- fi
+ fi
echo -n -e "$((done/2)) \r"
done
#!/bin/bash
-# parse ini file
+# parse ini file
CONFIG_FILE="config.ini"
# copied and modified from http://mark.aufflick.com/blog/2007/11/08/parsing-ini-files-with-sed
CL_EXCLUDE=""
for i in "$@"; do
- case $i in
+ case $i in
--include=*)
- CL_INCLUDE=${i#*=}
+ CL_INCLUDE=${i#*=}
;;
--exclude=*)
- CL_EXCLUDE=${i#*=}
+ CL_EXCLUDE=${i#*=}
;;
-h|--help)
usage
# test if localdb already exist:
# yes:
# see if photo-db is newer? yes: merge them; no: do nothing
-# no:
+# no:
# create it
cp $REMOTEDB $LOCALDB
delete from rolls where id not in (select distinct roll_id from photos asc);
drop table rmphotoids;
-drop table jobs;
+drop table jobs;
drop table exports;
vacuum;