Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get supported image types #707

Open
wasinger opened this issue Mar 20, 2019 · 0 comments
Open

Get supported image types #707

wasinger opened this issue Mar 20, 2019 · 0 comments

Comments

@wasinger
Copy link
Contributor

Is there a way to get the image types an Imagine instance supports?

I would think of a method ImagineInterface::supportedTypes(): array that should return an array of mime types.

Additionally, a method ImagineInterface::supports($mime_type): boolean would be nice to check if a certain mime type is supported.

Or is there already another way to this? The only thing I see are private functions with hardcoded type lists (e.g. in Imagine\Imagick\Image there is a private function getMimeType($format) containing a static types array, but there's no way to read it out).

The implementation in the Imagine adapters could rely on:

  • imagetypes() for GD
  • Gmagick::queryformats() for Gmagick
  • Imagick::queryFormats() for Imagick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant