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

Supported format detection #1330

Merged
merged 7 commits into from Apr 13, 2024
Merged

Conversation

olivervogel
Copy link
Member

@olivervogel olivervogel commented Apr 13, 2024

See #1326

Examples

use Intervention\Image\Drivers\Imagick\Driver;
use Intervention\Image\Format;
use Intervention\Image\MediaType;
use Intervention\Image\FileExtension;

// create new driver object
$driver = new Driver();

// check if jpeg format is supported by file extension
$result = $driver->supports('jpg');

// check if gif format is supported by media type
$result = $driver->supports('image/gif');

// check if png format is supported by enum member
$result = $driver->supports(Format::PNG);

// check if avif format is supported by enum member
$result = $driver->supports(MediaType::IMAGE_AVIF);

// check if tiff format is supported by enum member
$result = $driver->supports(FileExtension::TIFF);

@olivervogel olivervogel added this to the 3.6.0 milestone Apr 13, 2024
@olivervogel olivervogel merged commit 8f6aabe into develop Apr 13, 2024
12 checks passed
@olivervogel olivervogel deleted the feature/supported-format-detection branch April 13, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant