diff options
Diffstat (limited to 'picture.go')
-rw-r--r-- | picture.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -481,14 +481,20 @@ func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string { } // GetPicture provides a function to get picture base name and raw content -// embed in XLSX by given worksheet and cell name. This function returns the -// file name in XLSX and file contents as []byte data types. For example: +// embed in spreadsheet by given worksheet and cell name. This function +// returns the file name in spreadsheet and file contents as []byte data +// types. For example: // // f, err := excelize.OpenFile("Book1.xlsx") // if err != nil { // fmt.Println(err) // return // } +// defer func() { +// if err := f.Close(); err != nil { +// fmt.Println(err) +// } +// }() // file, raw, err := f.GetPicture("Sheet1", "A2") // if err != nil { // fmt.Println(err) @@ -497,9 +503,6 @@ func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string { // if err := ioutil.WriteFile(file, raw, 0644); err != nil { // fmt.Println(err) // } -// if err = f.Close(); err != nil { -// fmt.Println(err) -// } // func (f *File) GetPicture(sheet, cell string) (string, []byte, error) { col, row, err := CellNameToCoordinates(cell) |