mime-type-detection
mime-type-detection copied to clipboard
Add support for stream resources in FinfoMimeTypeDetector::detectMimeType()
As far as I can tell it is valid to call that method with a resource. As such I think it's worth to attempt to detect the mime-type by the stream contents too. This should be viable via stream_get_contents() while maintaining the stream pointers using ftell() and fseek().
@frankdejonge Thank you very much for your prompt response! I've tried to address your valuable feedback. The updated version has the stream sample extraction isolated in a dedicated method as it got complex.
@frankdejonge Thanks again for your responsiveness. I think I've addressed your points, I'll let you "resolve" the conversations as you'll be the judge if the solutions are satisfactory.
Allowed myself to resolve the reviews in the hope to progress this further