-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathImageManagerInterface.php
More file actions
63 lines (56 loc) · 2.08 KB
/
ImageManagerInterface.php
File metadata and controls
63 lines (56 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
namespace Intervention\Image\Interfaces;
use Intervention\Image\Exceptions\RuntimeException;
interface ImageManagerInterface
{
/**
* Create new image instance with given width & height
*
* @link https://image.intervention.io/v3/basics/instantiation#create-new-images
*
* @throws RuntimeException
*/
public function create(int $width, int $height): ImageInterface;
/**
* Create new image instance from given input which can be one of the following
*
* - Path in filesystem
* - File Pointer resource
* - SplFileInfo object
* - Raw binary image data
* - Base64 encoded image data
* - Data Uri
* - Intervention\Image\Image Instance
*
* To decode the raw input data, you can optionally specify a decoding strategy
* with the second parameter. This can be an array of class names or objects
* of decoders to be processed in sequence. In this case, the input must be
* decodedable with one of the decoders passed. It is also possible to pass
* a single object or class name of a decoder.
*
* All decoders that implement the `DecoderInterface::class` can be passed. Usually
* a selection of classes of the namespace `Intervention\Image\Decoders`
*
* If the second parameter is not set, an attempt to decode the input is made
* with all available decoders of the driver.
*
* @link https://image.intervention.io/v3/basics/instantiation#read-image-sources
*
* @param string|array<string|DecoderInterface>|DecoderInterface $decoders
* @throws RuntimeException
*/
public function read(mixed $input, string|array|DecoderInterface $decoders = []): ImageInterface;
/**
* Create new animated image by given callback
*
* @link https://image.intervention.io/v3/basics/instantiation#create-animations
*
* @throws RuntimeException
*/
public function animate(callable $init): ImageInterface;
/**
* Return currently used driver
*/
public function driver(): DriverInterface;
}