title: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18472 bytes)
body: <p>I get the above error at this line:</p>
  
  <pre><code>imagefill($canvas, 0, 0, imagecolorallocate($canvas, 255, 255, 255));
  </code></pre>
  
  <p>the script works fine with all image types, but it crashes with images that has a resolution bigger than 4000 x 3000 pixles. The image itself is only 500kb.
  Here is all code:</p>
  
  <pre><code>$canvas = imagecreatetruecolor(imagesx($source), imagesy($source));
  imagefill($canvas, 0, 0, imagecolorallocate($canvas, 255, 255, 255));
  imagealphablending($canvas, TRUE);
  imagecopy($canvas, $source, 0, 0, 0, 0, imagesx($source), imagesy($source));
  imagedestroy($source);
  $quality = 100; // 0 = worst / smaller file, 100 = better / bigger file 
  imagejpeg($canvas, $strPath.$p_Id.".jpg", $quality);        //----- save image
  ImageDestroy($canvas);
  </code></pre>