diff options
author | xuri <xuri.me@gmail.com> | 2018-05-07 16:44:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 16:44:02 +0800 |
commit | 038e34250f3ff827d85434b65cbba86a95724318 (patch) | |
tree | a4c441c4e2b7f3cdb3d34dcc80ae8e2011736b3b /picture.go | |
parent | 3ca180f09c4a602068d890bd22e83ac48a83f5cf (diff) | |
parent | d04be7b33da84a3f2f768ee4f0de7c49ab69279e (diff) |
Merge pull request #220 from lunny/lunny/refactor
save bytes on memory instead of string
Diffstat (limited to 'picture.go')
-rw-r--r-- | picture.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -142,7 +142,7 @@ func (f *File) addSheetRelationships(sheet, relType, target, targetMode string) TargetMode: targetMode, }) output, _ := xml.Marshal(sheetRels) - f.saveFileList(rels, string(output)) + f.saveFileList(rels, output) return rID } @@ -163,7 +163,7 @@ func (f *File) deleteSheetRelationships(sheet, rID string) { } } output, _ := xml.Marshal(sheetRels) - f.saveFileList(rels, string(output)) + f.saveFileList(rels, output) } // addSheetLegacyDrawing provides function to add legacy drawing element to @@ -257,7 +257,7 @@ func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, width, he } content.TwoCellAnchor = append(content.TwoCellAnchor, &twoCellAnchor) output, _ := xml.Marshal(content) - f.saveFileList(drawingXML, string(output)) + f.saveFileList(drawingXML, output) } // addDrawingRelationships provides function to add image part relationships in @@ -285,7 +285,7 @@ func (f *File) addDrawingRelationships(index int, relType, target, targetMode st TargetMode: targetMode, }) output, _ := xml.Marshal(drawingRels) - f.saveFileList(rels, string(output)) + f.saveFileList(rels, output) return rID } @@ -307,7 +307,7 @@ func (f *File) addMedia(file, ext string) { count := f.countMedia() dat, _ := ioutil.ReadFile(file) media := "xl/media/image" + strconv.Itoa(count+1) + ext - f.XLSX[media] = string(dat) + f.XLSX[media] = dat } // setContentTypePartImageExtensions provides function to set the content type |