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

Commit a505bc7

Browse files
author
Steve Canny
committed
add 'jpg' default content type
1 parent 647ee97 commit a505bc7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docx.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,14 @@ def contenttypes():
215215
for part in parts:
216216
types.append(makeelement('Override',nsprefix=None,attributes={'PartName':part,'ContentType':parts[part]}))
217217
# Add support for filetypes
218-
filetypes = {'rels':'application/vnd.openxmlformats-package.relationships+xml','xml':'application/xml','jpeg':'image/jpeg','gif':'image/gif','png':'image/png'}
218+
filetypes =\
219+
{ 'gif' : 'image/gif'
220+
, 'jpeg' : 'image/jpeg'
221+
, 'jpg' : 'image/jpeg'
222+
, 'png' : 'image/png'
223+
, 'rels' : 'application/vnd.openxmlformats-package.relationships+xml'
224+
, 'xml' : 'application/xml'
225+
}
219226
for extension in filetypes:
220227
types.append(makeelement('Default',nsprefix=None,attributes={'Extension':extension,'ContentType':filetypes[extension]}))
221228
return types

0 commit comments

Comments
 (0)