Lines Matching defs:height
15 /** @var int height of the current image */
16 protected $height = 0;
97 list($this->width, $this->height) = [$this->height, $this->width];
100 list($this->width, $this->height) = [$this->height, $this->width];
125 public function resize($width, $height)
127 list($width, $height) = $this->boundingBox($width, $height);
128 $this->resizeOperation($width, $height);
136 public function crop($width, $height)
138 list($this->width, $this->height, $offsetX, $offsetY) = $this->cropPosition($width, $height);
139 $this->resizeOperation($width, $height, $offsetX, $offsetY);
184 $this->height = $info[1];
209 * @param int $height
213 protected function createImage($width, $height)
218 $canvas = @imagecreatetruecolor($width, $height);
221 $canvas = @imagecreate($width, $height);
287 * If widht and height are given, the new size will be fit within this bounding box.
291 * @param int $height height of the bounding box
292 * @return array (width, height)
295 protected function boundingBox($width, $height)
298 $height = $this->cleanDimension($height, $this->height);
300 if ($width == 0 && $height == 0) {
304 if (!$height) {
306 $height = round(($width * $this->height) / $this->width);
308 // adjust to match height
309 $width = round(($height * $this->width) / $this->height);
312 $scale = min($width / $this->width, $height / $this->height);
314 $height = $this->height * $scale;
317 return [$width, $height];
347 * @param int $height
351 protected function cropPosition($width, $height)
353 if ($width == 0 && $height == 0) {
357 if (!$height) {
358 $height = $width;
362 $width = $height;
366 $oldRatio = $this->width / $this->height;
367 $newRatio = $width / $height;
375 $cropWidth = (int)($this->height * $newRatio);
376 $cropHeight = $this->height;
380 $cropWidth = (int)($this->height * $newRatio);
381 $cropHeight = $this->height;
390 $offsetY = (int)(($this->height - $cropHeight) / 2);
399 * @param int $toHeight desired height
421 $this->height
434 $this->height
442 $this->height = $toHeight;