Lines Matching full:image
7 * Image processing adapter for PHP's libGD
11 /** @var resource libGD image */
12 protected $image; variable in splitbrain\\slika\\GdAdapter
13 /** @var int width of the current image */
15 /** @var int height of the current image */
25 $this->image = $this->loadImage($imagepath);
33 // destroy the GD image resource (only needed on PHP < 8.0)
34 if (is_resource($this->image)) {
35 imagedestroy($this->image);
67 $transparency = imagecolorallocatealpha($this->image, 0, 0, 0, 127);
69 // rotate (orientation 2 is a flip-only case and keeps $this->image)
70 $image = $this->image;
72 $image = imagerotate($this->image, 180, $transparency);
74 $image = imagerotate($this->image, -90, $transparency);
77 $image = imagerotate($this->image, 90, $transparency);
83 imageflip($image, IMG_FLIP_HORIZONTAL);
86 if ($image !== $this->image) {
87 $this->__destruct(); // destroy old image
88 $this->image = $image;
93 imagealphablending($this->image, false);
94 imagesavealpha($this->image, true);
134 $saver = 'image' . $extension;
136 throw new Exception('Can not save image format ' . $extension);
140 imagejpeg($this->image, $path, $this->options['quality']);
142 $saver($this->image, $path);
149 * Initialize libGD on the given image
160 throw new Exception('Failed to read image information');
165 // what type of image is it?
169 throw new Exception('Can not work with image format ' . $this->extension);
173 $image = @$creator($path);
175 if ($image === false) {
176 throw new Exception('Failed to load image wiht libGD');
179 return $image;
183 * Creates a new blank image to which we can copy
214 $this->keepGifTransparency($this->image, $canvas);
225 * @param resource $image Original image
226 * @param resource $canvas New, empty image
229 protected function keepGifTransparency($image, $canvas) argument
240 $transcolorindex = @imagecolortransparent($image);
241 $transcolor = @imagecolorsforindex($image, $transcolorindex);
267 * from the original image to be then resized to the wanted dimensions.
336 $this->image,
349 $this->image,
361 // destroy original GD image ressource and replace with new one
363 $this->image = $newimg;