title: Insert Image PhpWord
body: <p>I can add images using URL but not trying to get a local image file.</p>
  
  <pre><code>$portada-&gt;addImage('earth.jpg');
  </code></pre>
  
  <p>Getting this error:</p>
  
  <blockquote>
    <p>Uncaught PHP Exception PhpOffice\PhpWord\Exception\InvalidImageException: "" at C:\Users\kaskull\Desktop\symfony\examsgenerator\vendor\phpoffice\phpword\src\PhpWord\Element\Image.php line 386</p>
  </blockquote>
  
  <p>I'm createing my Word on a controller so my first idea is that should be something like this:</p>
  
  <pre><code>$portada-&gt;addImage('../Resources/Asset/images/logo.png');
  </code></pre>
  
  <p>Getting the same error.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>If i do:</p>
  
  <pre><code>$path = realpath('../Resources/Asset/images/logo.png');var_dump(is_readable($path));
  </code></pre>
  
  <p>It returns FALSE</p>
  
  <p>But if i use this, it runs.</p>
  
  <pre><code>$path=realpath('C:\Users\CARLES\Desktop\symfony\examsfinal\src\AppBundle\Resources\Asset\images\logo.png');
  </code></pre>