Cheetah
Encoder.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Intervention\Image\Gd;
4 
6 {
12  protected function processJpeg()
13  {
14  ob_start();
15  imagejpeg($this->image->getCore(), null, $this->quality);
16  $this->image->mime = image_type_to_mime_type(IMAGETYPE_JPEG);
17  $buffer = ob_get_contents();
18  ob_end_clean();
19 
20  return $buffer;
21  }
22 
28  protected function processPng()
29  {
30  ob_start();
31  $resource = $this->image->getCore();
32  imagealphablending($resource, false);
33  imagesavealpha($resource, true);
34  imagepng($resource, null, -1);
35  $this->image->mime = image_type_to_mime_type(IMAGETYPE_PNG);
36  $buffer = ob_get_contents();
37  ob_end_clean();
38 
39  return $buffer;
40  }
41 
47  protected function processGif()
48  {
49  ob_start();
50  imagegif($this->image->getCore());
51  $this->image->mime = image_type_to_mime_type(IMAGETYPE_GIF);
52  $buffer = ob_get_contents();
53  ob_end_clean();
54 
55  return $buffer;
56  }
57 
63  protected function processTiff()
64  {
65  throw new \Intervention\Image\Exception\NotSupportedException(
66  "TIFF format is not supported by Gd Driver."
67  );
68  }
69 
75  protected function processBmp()
76  {
77  throw new \Intervention\Image\Exception\NotSupportedException(
78  "BMP format is not supported by Gd Driver."
79  );
80  }
81 
87  protected function processIco()
88  {
89  throw new \Intervention\Image\Exception\NotSupportedException(
90  "ICO format is not supported by Gd Driver."
91  );
92  }
93 
99  protected function processPsd()
100  {
101  throw new \Intervention\Image\Exception\NotSupportedException(
102  "PSD format is not supported by Gd Driver."
103  );
104  }
105 }
Intervention\Image\Gd\Encoder\processPsd
processPsd()
Definition: Encoder.php:99
php
Intervention\Image\Gd
Definition: Color.php:3
Intervention\Image\Gd\Encoder
Definition: Encoder.php:6
Intervention\Image\Gd\Encoder\processIco
processIco()
Definition: Encoder.php:87
Intervention\Image\Gd\Encoder\processTiff
processTiff()
Definition: Encoder.php:63
Intervention\Image\Gd\Encoder\processPng
processPng()
Definition: Encoder.php:28
Intervention\Image\Gd\Encoder\processGif
processGif()
Definition: Encoder.php:47
Intervention\Image\AbstractEncoder
Definition: AbstractEncoder.php:6
image
License THE YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS Definitions Adaptation means a work based upon the or upon the Work and other pre existing such as a derivative arrangement of music or other alterations of a literary or artistic or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be or adapted including in any form recognizably derived from the except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License For the avoidance of where the Work is a musical performance or the synchronization of the Work in timed relation with a moving image("synching") will be considered an Adaptation for the purpose of this License. 2. "Collection" means a collection of literary or artistic works
Intervention\Image\Gd\Encoder\processBmp
processBmp()
Definition: Encoder.php:75
Intervention\Image\Gd\Encoder\processJpeg
processJpeg()
Definition: Encoder.php:12