Download the PHP package rosell-dk/image-mime-type-sniffer without Composer

On this page you can find all versions of the php package rosell-dk/image-mime-type-sniffer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package image-mime-type-sniffer

Image Mime Type Sniffer

Latest Stable Version Minimum PHP Version Build Status Software License Coverage Monthly Downloads Dependents

Gets mime type of common image files by sniffing the file content, looking for signatures.

The fact that this library limits its ambition to sniff images makes it light and simple. It is also quite fast. Most other sniffers iterates through all common signatures, however this library uses a mix of finite-state machine approach and iteration to achieve a good balance of speed, compactness, simplicity and readability.

The library recognizes the most widespread image formats, such as GIF, JPEG, WEBP, AVIF, JPEG-2000 and HEIC.

Usage

PS: An \Exception is thrown if the file is unreadable.

Platforms

Works on (at least): OS: Ubuntu (22.04, 20.04), Windows (2022, 2019), Mac OS (11, 10.15) PHP: 5.6 - 8.2 (also tested 8.3 and 8.4 development versions in October 2023)

Each new release will be tested on all combinations of OSs and PHP versions that are supported by GitHub-hosted runners. Except that we do not below PHP 5.6.

Testing consists of running the unit tests. The code in this library is almost completely covered by tests (~97% coverage).

Release 1.1.1 has been tested in PHP: 5.6 - 8.2 on the following OSs: Ubuntu (22.04, 20.04, 18.04), Windows (2022, 2019), Mac OS (13, 12, 11, 10.15). Code coverage: ~97%. For some reason PHP 5.6 testing fails on Windows

List of recognized image types:

TODO: image/heif

Alternatives

I have created a library that uses this library as well as other methods (finfo, exif_imagetype, etc) for determining image type. You might want to use that instead, to cover all bases. It is available here: image-mime-type-guesser.

There are also other PHP mime type sniffers out there:

Do you like what I do?

Perhaps you want to support my work, so I can continue doing it :)


All versions of image-mime-type-sniffer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rosell-dk/image-mime-type-sniffer contains the following files

Loading the files please wait ....