Properly processing non-existing images.
This commit is contained in:
parent
d8f78d82de
commit
5df0266bb3
|
@ -37,7 +37,7 @@ class InvoiceGenerator
|
|||
$new = [];
|
||||
|
||||
foreach ($paths as $key => $path) {
|
||||
$new[$key] = file_get_contents(Kernel::getProjectRoot().'/'.$path);
|
||||
$new[$key] = file_exists($path) ? file_get_contents(Kernel::getProjectRoot().'/'.$path) : null;
|
||||
}
|
||||
|
||||
return $new;
|
||||
|
|
|
@ -111,10 +111,12 @@
|
|||
<tr>
|
||||
<td height="50px">{{ 'label_signature'|trans(locale) }}</td>
|
||||
<td colspan="2" valign="bottom">
|
||||
{% if images.signature is defined and images.signature is not empty %}
|
||||
<img src="{{ images.signature|data_uri(mime='image/png') }}" alt="Signature">
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if images.stamp is defined %}
|
||||
{% if images.stamp is defined and images.stamp is not empty %}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<img src="{{ images.stamp|data_uri(mime='image/png') }}" alt="Stamp">
|
||||
|
|
Loading…
Reference in a new issue