<Default Extension="jpg" ContentType="image/jpeg"/>
[/code]
Now that my HTML contained other JPEGs, PHPDOCX adds the line[code]
<Default Extension="jpg" ContentType="image/jpg"/>
[/code] to "[Content_Types].xml". Now there are two entries for the file extension "jpg", one mapping to MIME type "image/jpeg" and one mapping to MIME type "image/jpg". Btw. "image/jpeg" seems to be the official one.
The cause of the issue is in "CreateTemplate::addContentTypes()" in "classes/conf/CreateTemplate.inc:390":[code]
//let´s check that tha conten type does not exist yet
if(strpos(self::$_contentTypes, $args[0]) === false){
$domContentTypes = new DomDocument();
[...]
self::$_contentTypes = $domContentTypes->saveXML();
}[/code]
'strpos()' doesn't find a "default extension" entry with ContentType "image/jpg" and therefore it gets added.
Going back in the call stack I found that in the same file in line 1691 ("CreateTemplate::TemplateHTMLRels()")[code]
$this->addContentTypes('<Default Extension="'.$extension.'" ContentType="image/'.$extension.'"/>');
[/code]
gets called, with the assumption that the proper MIME type / ContentType for an image with the file extension "X" ist "image/X". Maybe this need to be fixed.
I'd like to file a bug on this topic. Is there a bugtracker?