-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathImageManagerInterface.php
More file actions
88 lines (76 loc) Β· 2.85 KB
/
ImageManagerInterface.php
File metadata and controls
88 lines (76 loc) Β· 2.85 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
declare(strict_types=1);
namespace Intervention\Image\Interfaces;
use SplFileInfo;
use Stringable;
interface ImageManagerInterface
{
/**
* Create a new image manager using the given driver.
*/
public static function usingDriver(string|DriverInterface $driver, mixed ...$options): self;
/**
* Create a new image with the given width and height.
*/
public function createImage(
int $width,
int $height,
null|callable|AnimationFactoryInterface $animation = null,
): ImageInterface;
/**
* Decode an image from the given source which can be one of the following:
*
* - Path in filesystem
* - Raw binary image data
* - SplFileInfo object
* - Base64 encoded image data
* - Data URI string or instance of DataUriInterface
* - Stream resource
* - Instance of ImageInterface
* - Instance of EncodedImageInterface
*
* Optionally, one or more specific decoders can be provided. If no
* decoders are specified, all available decoders will be tried.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-image-sources
*
* @param null|string|array<string|DecoderInterface>|DecoderInterface $decoders
*/
public function decode(mixed $source, null|string|array|DecoderInterface $decoders = null): ImageInterface;
/**
* Decode an image from the given file path.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-images-from-file-paths
*/
public function decodePath(string|Stringable $path): ImageInterface;
/**
* Decode an image from the given raw binary data.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-images-from-binary-data
*/
public function decodeBinary(string|Stringable $binary): ImageInterface;
/**
* Decode an image from the given SplFileInfo object.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-images-from-splfileinfo-objects
*/
public function decodeSplFileInfo(SplFileInfo $splFileInfo): ImageInterface;
/**
* Decode an image from the given base64 encoded data.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-images-from-base64-encoded-data
*/
public function decodeBase64(string|Stringable $base64): ImageInterface;
/**
* Decode an image from the given data URI.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-images-from-data-uri-scheme
*/
public function decodeDataUri(string|Stringable|DataUriInterface $dataUri): ImageInterface;
/**
* Decode an image from the given stream resource.
*
* @link https://image.intervention.io/v4/basics/instantiation#read-images-from-stream
*/
public function decodeStream(mixed $stream): ImageInterface;
}