Nextrek
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
<?php
namespace Intervention\Image\Gd;
class Encoder extends \Intervention\Image\AbstractEncoder
{
/**
* Processes and returns encoded image as JPEG string
*
* @return string
*/
protected function processJpeg()
{
ob_start();
imagejpeg($this->image->getCore(), null, $this->quality);
$this->image->mime = image_type_to_mime_type(IMAGETYPE_JPEG);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
/**
* Processes and returns encoded image as PNG string
*
* @return string
*/
protected function processPng()
{
ob_start();
$resource = $this->image->getCore();
imagealphablending($resource, false);
imagesavealpha($resource, true);
imagepng($resource, null, -1);
$this->image->mime = image_type_to_mime_type(IMAGETYPE_PNG);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
/**
* Processes and returns encoded image as GIF string
*
* @return string
*/
protected function processGif()
{
ob_start();
imagegif($this->image->getCore());
$this->image->mime = image_type_to_mime_type(IMAGETYPE_GIF);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
/**
* Processes and returns encoded image as TIFF string
*
* @return string
*/
protected function processTiff()
{
throw new \Intervention\Image\Exception\NotSupportedException(
"TIFF format is not supported by Gd Driver."
);
}
/**
* Processes and returns encoded image as BMP string
*
* @return string
*/
protected function processBmp()
{
throw new \Intervention\Image\Exception\NotSupportedException(
"BMP format is not supported by Gd Driver."
);
}
/**
* Processes and returns encoded image as ICO string
*
* @return string
*/
protected function processIco()
{
throw new \Intervention\Image\Exception\NotSupportedException(
"ICO format is not supported by Gd Driver."
);
}
/**
* Processes and returns encoded image as PSD string
*
* @return string
*/
protected function processPsd()
{
throw new \Intervention\Image\Exception\NotSupportedException(
"PSD format is not supported by Gd Driver."
);
}
}
|
Revision |
Author |
Commited |
Message |
1464
|
MOliva
|
Tue 13 Oct, 2020 11:16:56 +0000 |
|