title: php imagick - read image from base64
body: <p>I am manipulating images with js, and I'd like to save these transformed images. I'm posting this data with ajax:</p>
  
  <pre><code>image : canvas.toDataURL('image/jpeg')
  </code></pre>
  
  <p>This way, I get the base64 code for the image, but I can't find a way to read it with Imagick.</p>
  
  <p>This is my process:</p>
  
  <pre><code>$img = new Imagick();
  $decoded = base64_decode($_POST['image']);
  $img-&gt;readimageblob($decoded);
  </code></pre>
  
  <p>But this fails:</p>
  
  <p>Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `' @ error/blob.c/BlobToImage/360' in /Library/WebServer/Documents/test/save.php:7
  Stack trace:</p>
  
  <p>#0 /Library/WebServer/Documents/test/save.php(7): Imagick->readimageblob('u?Z?f?{??z?????...')</p>
  
  <p>Any ideas why?</p>