Skip to content

Commit

Permalink
This closes #1017, fix duplicate image caused by incorrect internal r…
Browse files Browse the repository at this point in the history
…elationships ID calculation
  • Loading branch information
xuri committed Sep 10, 2021
1 parent dad8f49 commit 52609ba
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions picture.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 52609ba

Please sign in to comment.