fix crash on empty directory which in turn causes an empty report.
add file scanner to detect invalid magic types.
reuse scanner instances, pass file to scanner method instead.