mime-type-detection icon indicating copy to clipboard operation
mime-type-detection copied to clipboard

Add support for stream resources in FinfoMimeTypeDetector::detectMimeType()

Open das-peter opened this issue 1 year ago • 3 comments

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().

das-peter avatar Dec 20 '23 18:12 das-peter

@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.

das-peter avatar Dec 21 '23 08:12 das-peter

@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.

das-peter avatar Dec 21 '23 08:12 das-peter

Allowed myself to resolve the reviews in the hope to progress this further

das-peter avatar Jan 10 '24 10:01 das-peter