image icon indicating copy to clipboard operation
image copied to clipboard

Configuration API

Open olivervogel opened this issue 1 year ago • 0 comments

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'
);

olivervogel avatar May 10 '24 08:05 olivervogel