- fn="${file##*/}"
-
- while ! mkdir "${meta}.lock"; do
- sleep 1
- ps -o pid \
- | grep -q "$(cat "${meta}.lock/pid")" \
- || break
- done
- printf '%i\n' >"${meta}.lock/pid"
-
- grep -vF " $fn" "$meta" >"${meta}.lock/mtmp"
- read length width height tags comment x <<-EOF
- $(grep -F " $fn" "$meta")
+
+ fn="$(meta_name "$file")"
+ read -r length width height tags comment discard <<-EOF
+ $(meta_info "$file")
+ EOF
+ [ "${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)