Hello,
We have done quick tests with your image and it's being added perfectly.
Adding an image in a DOCX created from scratch:
<?php
require_once 'Classes/Phpdocx/Create/CreateDocx.inc';
$docx = new Phpdocx\Create\CreateDocx();
$options = array(
'src' => 'afbeeldung.png',
'height' => 300,
'width' => 600,
'dpi' => 96,
);
$docx->addImage($options);
$docx->createDocx('output');
Replacing a placeholder in a template:
<?php
require_once 'Classes/Phpdocx/Create/CreateDocx.inc';
$docx = new Phpdocx\Create\CreateDocxFromTemplate('examples/files/TemplateWordFragment_1.docx');
$image = new Phpdocx\Elements\WordFragment($docx, 'document');
$image->addImage(array(
'src' => 'afbeeldung.png',
'height' => 300,
'width' => 600,
'dpi' => 96,
));
$docx->replaceVariableByWordFragment(array('WORDFRAGMENT' => $image), array('type' => 'inline'));
$docx->createDocx('output_2');
In both cases, the image appears fine. Please run both scripts and check the DOCX outputs (you can find TemplateWordFragment_1.docx in the examples/files folder of the package).
We think the problem may come from some special content or filter in the template or that it's being added as 96 dpi and the image is 72 dpi. If you send the DOCX generated by your script to contact[at]phpdocx.com the dev team will check it if the problem is when the image is added or when it's opened by MS Word.
Regards.