1 | <?php |
||
5 | class Image |
||
6 | { |
||
7 | /** |
||
8 | * Return image URL to serve based on given parameters. |
||
9 | * |
||
10 | * @param string $url |
||
11 | * @param integer $width |
||
12 | * @param integer $height |
||
13 | * @param string $format |
||
14 | * @param integer $quality |
||
15 | * @param boolean|null $useProgressive |
||
16 | * @param string $fit |
||
17 | * @return string |
||
18 | */ |
||
19 | 18 | public static function url( |
|
51 | |||
52 | /** |
||
53 | * @param null|string $url |
||
54 | * @param string $imageUrl |
||
55 | * @return string |
||
56 | */ |
||
57 | 16 | protected static function replaceHosts(?string $url, string $imageUrl): string |
|
73 | |||
74 | /** |
||
75 | * Auto-detect image format to serve (based on browser capability). |
||
76 | * |
||
77 | * @param string $format |
||
78 | * @return string|null |
||
79 | */ |
||
80 | 16 | protected static function detectFormat(string $format = ''): ?string |
|
94 | |||
95 | /** |
||
96 | * @param null|string $fit |
||
97 | * @return null|string |
||
98 | */ |
||
99 | 16 | protected static function detectFit(?string $fit = null): ?string |
|
110 | |||
111 | /** |
||
112 | * @param null|string $format |
||
113 | * @param bool|null $useProgressive |
||
114 | * @return bool |
||
115 | */ |
||
116 | 16 | protected static function detectProgressive(?string $format = '', ?bool $useProgressive = null): bool |
|
128 | } |