title: onerror image not displayed when image does not exist
body: <p>I'm using this code:</p>
  
  <pre><code>function base64_encode_image ($filename=string,$filetype=string) {
      if ($filename) {
          $imgbinary = fread(fopen($filename, "r"), filesize($filename));
          return 'data:image/' . $filetype . ';base64,' . base64_encode($imgbinary);
      }
  }}
  
  
  &lt;img src="&lt;?php echo base64_encode_image ('img/123.jpg','jpg'); ?&gt;" alt='' onerror="this.onerror=null;this.src='img/no-image.jpg';"/&gt;
  </code></pre>
  
  <p>The problem is that the onerror image (no-image.jpg) is not showing although 123.jpg image does not exist.</p>
  
  <p>I get the following error message:
  Warning: filesize(): stat failed for img/123.jpg</p>
  
  <p>Any help would be appreciated.</p>