Cheetah
Encoder.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
12  protected function processJpeg()
13  {
14  $format = 'jpeg';
15  $compression = \Imagick::COMPRESSION_JPEG;
16 
17  $imagick = $this->image->getCore();
18  $imagick->setImageBackgroundColor('white');
19  $imagick->setBackgroundColor('white');
20  $imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_MERGE);
21  $imagick->setFormat($format);
22  $imagick->setImageFormat($format);
23  $imagick->setCompression($compression);
24  $imagick->setImageCompression($compression);
25  $imagick->setCompressionQuality($this->quality);
26  $imagick->setImageCompressionQuality($this->quality);
27 
28  return $imagick->getImagesBlob();
29  }
30 
36  protected function processPng()
37  {
38  $format = 'png';
39  $compression = \Imagick::COMPRESSION_ZIP;
40 
41  $imagick = $this->image->getCore();
42  $imagick->setFormat($format);
43  $imagick->setImageFormat($format);
44  $imagick->setCompression($compression);
45  $imagick->setImageCompression($compression);
46 
47  return $imagick->getImagesBlob();
48  }
49 
55  protected function processGif()
56  {
57  $format = 'gif';
58  $compression = \Imagick::COMPRESSION_LZW;
59 
60  $imagick = $this->image->getCore();
61  $imagick->setFormat($format);
62  $imagick->setImageFormat($format);
63  $imagick->setCompression($compression);
64  $imagick->setImageCompression($compression);
65 
66  return $imagick->getImagesBlob();
67  }
68 
74  protected function processTiff()
75  {
76  $format = 'tiff';
77  $compression = \Imagick::COMPRESSION_UNDEFINED;
78 
79  $imagick = $this->image->getCore();
80  $imagick->setFormat($format);
81  $imagick->setImageFormat($format);
82  $imagick->setCompression($compression);
83  $imagick->setImageCompression($compression);
84  $imagick->setCompressionQuality($this->quality);
85  $imagick->setImageCompressionQuality($this->quality);
86 
87  return $imagick->getImagesBlob();
88  }
89 
95  protected function processBmp()
96  {
97  $format = 'bmp';
98  $compression = \Imagick::COMPRESSION_UNDEFINED;
99 
100  $imagick = $this->image->getCore();
101  $imagick->setFormat($format);
102  $imagick->setImageFormat($format);
103  $imagick->setCompression($compression);
104  $imagick->setImageCompression($compression);
105 
106  return $imagick->getImagesBlob();
107  }
108 
114  protected function processIco()
115  {
116  $format = 'ico';
117  $compression = \Imagick::COMPRESSION_UNDEFINED;
118 
119  $imagick = $this->image->getCore();
120  $imagick->setFormat($format);
121  $imagick->setImageFormat($format);
122  $imagick->setCompression($compression);
123  $imagick->setImageCompression($compression);
124 
125  return $imagick->getImagesBlob();
126  }
127 
133  protected function processPsd()
134  {
135  $format = 'psd';
136  $compression = \Imagick::COMPRESSION_UNDEFINED;
137 
138  $imagick = $this->image->getCore();
139  $imagick->setFormat($format);
140  $imagick->setImageFormat($format);
141  $imagick->setCompression($compression);
142  $imagick->setImageCompression($compression);
143 
144  return $imagick->getImagesBlob();
145  }
146 }
Intervention\Image\Imagick\Encoder\processBmp
processBmp()
Definition: Encoder.php:95
Intervention\Image\AbstractEncoder\$format
$format
Definition: AbstractEncoder.php:26
Intervention\Image\Imagick
Definition: Color.php:3
Intervention\Image\Imagick\Encoder\processPsd
processPsd()
Definition: Encoder.php:133
php
Intervention\Image\Imagick\Encoder
Definition: Encoder.php:6
Intervention\Image\Imagick\Encoder\processJpeg
processJpeg()
Definition: Encoder.php:12
Intervention\Image\Imagick\Encoder\processIco
processIco()
Definition: Encoder.php:114
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\Imagick\Encoder\processPng
processPng()
Definition: Encoder.php:36
Intervention\Image\Imagick\Encoder\processGif
processGif()
Definition: Encoder.php:55
Intervention\Image\Imagick\Encoder\processTiff
processTiff()
Definition: Encoder.php:74