MpdfException IMAGE Error () : Error parsing image file - Yii2
<p>I'm stuck in very awkward situation where Images are being shown in Local Environment while generating PDF. But, Not in Production. <strong>Images being displayed as [X] when to generate PDFs with mPDF.</strong></p>

<p>After inserting <code>$mpdf-&gt;showImageErrors = true;</code> in <strong>Controller</strong>.</p>

<pre><code>public function actionExportCasesPdf($id) {
  .
  .
  .
  .
  $mpdf = new \mPDF();
  $mpdf-&gt;showImageErrors = true;
  $mpdf-&gt;WriteHTML($output);
  $mpdf-&gt;Output($fileName, 'D');
}
</code></pre>

<p><strong>Error</strong></p>

<blockquote>
  <p><strong>MpdfException</strong></p>
  
  <p>IMAGE Error (..17.jpg): Error parsing image file - image type not
  recognised, and not supported by GD imagecreate</p>
</blockquote>

<p>Even, GD library is installed in the server using <code>apt-get install php5-gd</code> command. And, Image Path are also used correct.</p>

<p>I tried to keep image source as such. But, No Luck.</p>

<pre><code>&lt;img src="&lt;?= \yii\helpers\Url::to('@web/images/logo.png', true) ?&gt;" width="100" alt="logo" /&gt;
</code></pre>

<p>I searched and tried the solution given by these links. But, still no luck :</p>

<ol>
<li><a href="https://github.com/kartik-v/yii2-mpdf/issues/19" rel="nofollow noreferrer">Images not showing on production but they do on local environment - GitHub</a></li>
<li><a href="https://stackoverflow.com/questions/22092683/mpdf-5-7-1-image-displays-as-a-broken-x">mPDF 5.7.1 - image displays as a broken [x]</a></li>
<li><a href="https://stackoverflow.com/questions/20543677/generated-picture-in-mpdf">Generated picture in mpdf</a></li>
<li><a href="https://wordpress.org/support/topic/error-parsing-image-file/" rel="nofollow noreferrer">Error parsing image file</a></li>
</ol>

<p>Any help/hint/suggestion is appreciable.</p>