You are here

public function Face_Detector::toJpeg in Image Focus Crop 7

Same name and namespace in other branches
  1. 6 php-facedetection/FaceDetector.php \Face_Detector::toJpeg()

File

php-facedetection/FaceDetector.php, line 80

Class

Face_Detector

Code

public function toJpeg() {
  $color = imagecolorallocate($this->canvas, 255, 0, 0);

  //red
  imagerectangle($this->canvas, $this->face['x'], $this->face['y'], $this->face['x'] + $this->face['w'], $this->face['y'] + $this->face['w'], $color);
  header('Content-type: image/jpeg');
  imagejpeg($this->canvas);
}