From 38ad20efc11c1872c4e62a12617f0300c138b867 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 7 May 2018 16:12:51 +0800 Subject: save bytes on memory instead of string --- picture.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'picture.go') diff --git a/picture.go b/picture.go index a7f48d1..6c84cdd 100644 --- a/picture.go +++ b/picture.go @@ -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 -- cgit v1.2.1