Yeah, most of the code is taken from here: https://github.com/schmittjoh/metadata/blob/master/src/Metadata/Driver/AbstractFileDriver.php