title: Intervention Image rounded corners upload
body: <p>I'm trying to upload my files as circles, but I can't make it work.
  I've seen some topics about applying a mask to the image, but when I apply the mask it takes way to long and the server shuts the request down.</p>
  
  <p>I'm using the <code>Intervention Image</code> library for Laravel</p>
  
  <p>My code is as follows: </p>
  
  <pre><code>$identifier = "{$this-&gt;loggedUser-&gt;id}" . str_random(9) . ".{$file-&gt;getClientOriginalExtension()}";
  $mask = $this-&gt;createCircleMask(200, 200);
  $thumbMask = $this-&gt;createCircleMask(40, 40);
  Image::make($file-&gt;getRealPath())-&gt;mask($mask)-&gt;save(public_path("images/profile/{$identifier}"));
  Image::make($file-&gt;getRealPath())-&gt;mask($thumbMask)-&gt;save(public_path("images/profile/thumbs/{$identifier}"));
  </code></pre>
  
  <p>The <code>createCircleMask</code> method looks like this:</p>
  
  <pre><code>public function createCircleMask($width, $height)
  {
      $circle = Image::canvas($width, $height, '#000000');
      return $circle-&gt;circle($width - 1, $width / 2, $height / 2);
  }
  </code></pre>