Skip to content

Instantly share code, notes, and snippets.

@fvovan
Last active September 7, 2016 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fvovan/bc431af28c5c59b44e665928fbcb5ee5 to your computer and use it in GitHub Desktop.
Save fvovan/bc431af28c5c59b44e665928fbcb5ee5 to your computer and use it in GitHub Desktop.
Imagick bug reproducing
<?php
error_reporting(E_ALL);
echo "Imagick test\n";
//$arr = str_repeat('x', 200 * pow(2, 20)); //megabytes
$animatedImagePath = 'https://www.dropbox.com/s/d6m3b432z2vrdna/gif-animated.gif?dl=1';
$imageContents = file_get_contents($animatedImagePath);
$imagick = new \Imagick();
$imagick->readImageBlob($imageContents);
/** @var Imagick $imagick */
$imagick = $imagick->coalesceImages();
$imageBlob = $imagick->getImagesBlob();
popen('ls', 'w'); // PHP Warning: popen(ls,w): Cannot allocate memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment