diff options
| author | xuri <xuri.me@gmail.com> | 2021-09-10 23:19:59 +0800 |
|---|---|---|
| committer | xuri <xuri.me@gmail.com> | 2021-09-10 23:19:59 +0800 |
| commit | 52609ba52678642810363cba485e60f370850ddc (patch) | |
| tree | cf799e91880b3589088cbc838d8527c4de1f0b29 | |
| parent | dad8f490cc2df664bf1e7c6770ecd89a0c0e7fe4 (diff) | |
This closes #1017, fix duplicate image caused by incorrect internal relationships ID calculation
| -rw-r--r-- | picture.go | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -253,24 +253,20 @@ func (f *File) addSheetPicture(sheet string, rID int) { // countDrawings provides a function to get drawing files count storage in the // folder xl/drawings. -func (f *File) countDrawings() int { - c1, c2 := 0, 0 +func (f *File) countDrawings() (count int) { f.Pkg.Range(func(k, v interface{}) bool { if strings.Contains(k.(string), "xl/drawings/drawing") { - c1++ + count++ } return true }) f.Drawings.Range(func(rel, value interface{}) bool { if strings.Contains(rel.(string), "xl/drawings/drawing") { - c2++ + count++ } return true }) - if c1 < c2 { - return c2 - } - return c1 + return } // addDrawingPicture provides a function to add picture by given sheet, |
