+
+ printf '%s:exists\n' "$sid" >>"$tempfile"
+ printf '%s_open:checked\n' "$sid" >>"$tempfile"
+
+elif [ -n "$_POST[imagedata]" ]; then
+ sed -rn 's;^(session[0-9]+)_open:checked$;\1;p' "$tempfile" \
+ | sort -n \
+ | tail -n1 \
+ | read sid
+
+ convert "${tpyfile%.tpy}_${sid}.png" \
+ -strokewidth 2 -fill '#00000000' \
+ -draw "${_POST[imagedata]}" -transparent white \
+ "${tpyfile%.tpy}_${sid}.png"
+ sync