title: PHP imagecreatefromjpeg fails on large image
body: <p>my image has about 5000x3000 pixels and I want to use the <code>imagecreatefromjpeg</code> function in PHP, however the image keeps just empty. When I try it with a smaller one It is working perfectly. I tried to set the <code>memory_limit</code> to 800M and also <code>ini_set('memory_limit', -1);</code>.</p>
  
  <p>My code:</p>
  
  <pre><code>header("Content-type: image/png");
  ini_set('memory_limit', -1);
  error_reporting(E_ALL);
  
  $img1 = imagecreatefromjpeg("1.jpg");
  $img2 = imagecreatefromjpeg('2.jpg');
  
  imagecopy($img1, $img2, 605, 109, 0, 0, 200, 200);
  
  imagepng($img1);
  imagedestroy($img1);
  </code></pre>
  
  <p>Output:
  <img src="https://i.stack.imgur.com/n0SOz.png" alt="Output"></p>
  
  <p>Errors:
  <img src="https://i.stack.imgur.com/dvhgf.png" alt="Errors"></p>
  
  <p>What else can I do</p>