Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions document/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module github.com/unidoc/unioffice

go 1.12