Jpeg, EMF, WMF, GIF images all are fine after being added to word, but PNG images are malformed in word (the streams I use are all perfectly fine, tested by decoding the streams on the web);
I can mail the word file upon request.
Code below:
/** @var FlowchartDefinition $content */
FileStreamHelper::registerStream($content);
$image = new WordFragment($docx, 'document');
$image->addImage([
'name' => $content->getFileId(),
'src' => FileStreamHelper::generateStreamUri($content),
'dpi' => 96,
'width' => $content->getWidth(),
'height' => $content->getHeight(),
'target' => 'document',
'mime' => $content->getMimeType()
]);
$docx->replaceVariableByWordFragment([$placeHolder => $image], ['type' => 'inline']);
FileStreamHelper::unregisterStream($content);