- [ "${length%%[1-9]*}" -o "${width%%[1-9]*}" -o "${height%%[1-9]*}" = 0 ] \
- && read -r length width height discard <<-EOF
- $(meta_line "$file"; echo Rereading meta for "$file" >&2)
- EOF
- [ "${tags%%tags=*}" ] && tags='tags=';
- [ "${comment%%comment=*}" ] && comment='comment='
+ [ "$fn" ] || continue
+ tags="$(UNSTRING "${tags#tags=}" |tr , '\n')"
+
+ if [ ! "$deltags" ]; then
+ extags="$(printf '%s' "${newtags}" |grep -e "^-" |cut -d: -f1 )"
+ [ "$extags" ] && tags="$(printf %s\\n "$tags" |grep -vwFe "$extags")"
+ if printf %s "${newtags}" |grep -e "^-" |grep -qEe "^-[^:]+$"; then
+ tags="$(printf %s\\n "$tags" |grep -vEe '^-[^:]+$')"
+ fi
+ tags="$(printf '%s\n' "${tags},${newtags}" \
+ | tr , '\n' |sort -u |tr '\n' , \
+ | STRING)"
+ else
+ detag="${deltags}${BR}"; while [ "$detag" ]; do
+ tags="$(printf '%s\n' "$tags" |grep -vxFe "${detag%%${BR}*}")"
+ detag="${detag#*${BR}}"
+ done
+ tags="$(printf '%s\n' "$tags" |sort -u |tr '\n' , |STRING)"
+ fi
+ tags="${tags#,}"; tags="${tags%,}"