From 0e704649e66219c6b910eb222624ec435b3a3b70 Mon Sep 17 00:00:00 2001 From: Thomas Bouder Date: Fri, 6 Sep 2019 21:18:31 +0200 Subject: [PATCH 1/2] Fix issue when adding an image in the header --- document/header.go | 5 +++++ go.mod | 2 ++ 2 files changed, 7 insertions(+) diff --git a/document/header.go b/document/header.go index ddccb6f17b..d3df8a53ca 100644 --- a/document/header.go +++ b/document/header.go @@ -125,6 +125,11 @@ func (h Header) AddImage(i common.Image) (common.ImageRef, error) { h.d.Images = append(h.d.Images, r) fn := fmt.Sprintf("media/image%d.%s", len(h.d.Images), i.Format) rel := hdrRels.AddRelationship(fn, unioffice.ImageType) + h.d.ContentTypes.EnsureDefault("png", "image/png") + h.d.ContentTypes.EnsureDefault("jpeg", "image/jpeg") + h.d.ContentTypes.EnsureDefault("jpg", "image/jpeg") + h.d.ContentTypes.EnsureDefault("wmf", "image/x-wmf") + h.d.ContentTypes.EnsureDefault(i.Format, "image/"+i.Format) r.SetRelID(rel.X().IdAttr) return r, nil } diff --git a/go.mod b/go.mod index 234a1742f8..69ca9694bf 100644 --- a/go.mod +++ b/go.mod @@ -1 +1,3 @@ module github.com/unidoc/unioffice + +go 1.12 From 3c332db1c273453e6b682f5b4623a8cd4abf80c3 Mon Sep 17 00:00:00 2001 From: Thomas Bouder Date: Wed, 4 Dec 2019 17:21:04 +0100 Subject: [PATCH 2/2] Delete go.mod --- go.mod | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 go.mod diff --git a/go.mod b/go.mod deleted file mode 100644 index 69ca9694bf..0000000000 --- a/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/unidoc/unioffice - -go 1.12