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

Configuration API #1350

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open

Configuration API #1350

wants to merge 26 commits into from

Conversation

olivervogel
Copy link
Member

@olivervogel olivervogel commented May 10, 2024

Available Configuration Options

Currently the following options are available.

Name Type Description
autoOrientation bool (optional) Decides whether the image should be automatically aligned based on the Exif data. Default: true
decodeAnimation bool (optional) Whether a possibly animated image is decoded as such or whether the animation is discarded. Default: true
blendingColor bool (optional) The default blending color. Default: ffffff

Apply Configuration Options

Configuration options can be set in three different ways in the Intervention\Image\ImageManager::class.

Option 1. Add configuration options to the ImageManager constructor

use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;

$manager = new ImageManager(
    Driver::class,
    autoOrientation: false,
    decodeAnimation: true,
    blendingColor: 'ff5500'
);

Option 2. Add configuration options to the static factory method of ImageManager

use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;

$manager = ImageManager::withDriver(
    Driver::class,
    autoOrientation: false,
    decodeAnimation: true,
    blendingColor: 'ff5500'
);

Option 3. Add configuration options to the static driver factory method ImageManager

use Intervention\Image\ImageManager;

// with gd
$manager = ImageManager::gd(
    autoOrientation: false,
    decodeAnimation: true,
    blendingColor: 'ff5500'
);

// or with imagick
$manager = ImageManager::imagick(
    autoOrientation: false,
    decodeAnimation: true,
    blendingColor: 'ff5500'
);

Set exif data of image to top-left orientation, marking the image as
aligned and making sure the rotation correction process is not
performed again.
@olivervogel olivervogel added this to the 3.7.0 milestone May 14, 2024
@olivervogel olivervogel changed the title Configuration Options Configuration API May 17, 2024
Move ColorObjectDecoder & ImageObjectDecoder from drivers context
because they can operate without any specific drivers information
must not be specialized.
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.

None yet

1 participant