title: Using mime_content_type in combination with ACF
body: <p>I have this function for getting the data URI of an image:</p>
  
  <pre><code>function get_dataURI($image){
      $imageData = base64_encode(file_get_contents($image));
      $src = 'data: '.mime_content_type($image).';base64,'.$imageData;
      echo $src;
  }
  </code></pre>
  
  <p>Now I want to use it in combination with the Advanced Custom Fields plugin in WordPress, but it isn't working:</p>
  
  <pre><code>&lt;img src="&lt;?php get_dataURI(get_sub_field('author_image')); ?&gt;" height="auto" /&gt;
  </code></pre>
  
  <p>If I remove the mime_content_type part of the function, it works, but then it doesn't give a correct data URI.</p>
  
  <p>Here is the error:</p>
  
  <pre><code>mime_content_type(): Failed identify data 0:(null) in [FUNCTIONS.PHP FILE PATH] on line 322
  </code></pre>
  
  <p>UPDATE: I noticed that the errors are there, because the function can't find the image path's. Any tips?</p>