rosell-dk/image-mime-type-sniffer
A small PHP library that detects an image's MIME type by inspecting its actual file contents rather than trusting the extension. Useful when validating uploads, since it relies on magic bytes and is easy to drop into existing projects.
rosell-dk/image-mime-type-sniffer is a tiny PHP library that determines an image's MIME type by inspecting the file's leading bytes instead of trusting its extension. It is handy for validating uploads, where a renamed .jpg could otherwise slip through, and it works without relying on fileinfo or getimagesize.
null for unrecognised content, making failure easy to handleImageMimeTypeSniffer::sniff($path)How can I help you explore Laravel packages today?