3 . "$_EXEC/cgilite/storage.sh"
4 . "$_EXEC/indexmeta.sh"
6 for select in $(seq 1 $(POST_COUNT select)); do
7 file="$_DATA/$ITEM/$(POST select $select)"
8 meta="${file%/*}/.index/meta"
10 fn="$(meta_name "$file")"
11 read -r length width height tags comment discard <<-EOF
14 [ "${length%%[1-9]*}" -o "${width%%[1-9]*}" -o "${height%%[1-9]*}" = 0 ] \
15 && read -r length width height discard <<-EOF
16 $(meta_line "$file"; echo Rereading meta for "$file" >&2)
18 [ "${tags%%tags=*}" ] && tags='tags=';
19 [ "${comment%%comment=*}" ] && comment='comment='
22 grep -avF " $fn" "$meta" >"${meta}.tmp"
24 tags="$(UNSTRING "${tags#tags=}" |tr , '\n')"
26 for tn in $(seq 1 $(POST_COUNT tag)); do
27 tags="$(printf '%s\n%s' "$tags" "$(POST tag $tn)")"
29 tags="$(printf '%s\n%s' "$tags" "$(POST newtag |tr -d '\r')")"
31 tags="$(printf %s "$tags" |sort -u |tr '\n' ,)"
32 printf '%i\t%i\t%i\ttags=%s\t%s\t%s\n' \
33 "$length" "$width" "$height" \
34 "$(STRING "${tags#,}")" \
37 mv "${meta}.tmp" "$meta"