Skip to content
This repository has been archived by the owner on Jan 12, 2018. It is now read-only.

Commit

Permalink
add 'jpg' default content type
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Canny committed Jan 9, 2013
1 parent 647ee97 commit a505bc7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docx.py
Expand Up @@ -215,7 +215,14 @@ def contenttypes():
for part in parts:
types.append(makeelement('Override',nsprefix=None,attributes={'PartName':part,'ContentType':parts[part]}))
# Add support for filetypes
filetypes = {'rels':'application/vnd.openxmlformats-package.relationships+xml','xml':'application/xml','jpeg':'image/jpeg','gif':'image/gif','png':'image/png'}
filetypes =\
{ 'gif' : 'image/gif'
, 'jpeg' : 'image/jpeg'
, 'jpg' : 'image/jpeg'
, 'png' : 'image/png'
, 'rels' : 'application/vnd.openxmlformats-package.relationships+xml'
, 'xml' : 'application/xml'
}
for extension in filetypes:
types.append(makeelement('Default',nsprefix=None,attributes={'Extension':extension,'ContentType':filetypes[extension]}))
return types
Expand Down

0 comments on commit a505bc7

Please sign in to comment.