title: gd-png cannot allocate image data
body: <p>I have an old code base that makes extensive use of GD (no, switching to imagemagick is not an option). It's been running for several years, through several versions. However, when I run it in my current development environment, I'm running into a mysterious gd-png error: cannot allocate image data errors when calling <code>imagecreatefrompng()</code>. The PNG file I'm using is the same as I've been using, so I know it works.</p>
  
  <p>Current setup:  </p>
  
  <pre><code>Ansible-provisioned vagrant box  
  Ubuntu 14.04  
  PHP 5.5.9  
  GD 2.1.1  
  libPNG 1.2.50
  </code></pre>
  
  <p>PHP's memory limit at the time the script is run is 650M, though it's ultimately the kernel itself that ends up killing the script, and changing PHP's memory limit doesn't seem to have an effect.</p>
  
  <p>The image dimensions are 7200x6600 and are about 500KiB on disk. This hasn't been a problem in my other environments and is only newly-occurring in my development environment. Unfortunately, I don't have access to the other environments anymore to do a comparison, though the setup was similar in the last working one -- Ubuntu 14.04, PHP 5.5, sufficient memory allocations.</p>
  
  <p>What could be happening in this setup that wasn't happening in my previous setups? How can I fix this?</p>