title: How to create GD Image from base64 encoded jpeg?
body: <p>I have an upload Api that as a response object delivers (along with other stuff inside a Json object) a base64 encoded jpeg image.</p>
  
  <p>I create the encoded image as so:</p>
  
  <pre><code>$im; // gd image resource
  ob_start();
  imagejpeg($im);
  $data = base64_encode(ob_get_clean());
  </code></pre>
  
  <p>The data then is put inside a form field using javascript and submitted.</p>
  
  <p>How can I create a GD resource from that again so that I actually can save that image as a file?</p>
  
  <p>Everything in PHP.</p>