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

feature/better input handler #1250

Merged
merged 9 commits into from
Jan 16, 2024
Merged

Conversation

olivervogel
Copy link
Member

@olivervogel olivervogel commented Jan 5, 2024

Addresses #361

Code Example of new features

use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;
use Intervention\Image\Decoders\DataUriImageDecoder;
use Intervention\Image\Decoders\Base64ImageDecoder;
use Intervention\Image\Decoders\FilePathImageDecoder;

// create new manager instance with desired driver
$manager = new ImageManager(new Driver());

// read image only from data uri or base64 encoded data
$image = $manager->read($input, [
    DataUriImageDecoder::class,
    Base64ImageDecoder::class,
]);

// read image only from file path
$image = $manager->read($input, FilePathImageDecoder::class);

// same with object instead of class name
$image = $manager->read($input, new FilePathImageDecoder());

@olivervogel olivervogel linked an issue Jan 5, 2024 that may be closed by this pull request
@olivervogel olivervogel added this to the Version 3.3.0 milestone Jan 6, 2024
@olivervogel olivervogel merged commit 448c415 into develop Jan 16, 2024
@olivervogel olivervogel deleted the feature/better-input-handler branch January 20, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No easy way of explicitly specifying decoder format
1 participant