Skip to content

Commit 52609ba

Browse files
committed
This closes qax-os#1017, fix duplicate image caused by incorrect internal relationships ID calculation
1 parent dad8f49 commit 52609ba

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

picture.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,24 +253,20 @@ func (f *File) addSheetPicture(sheet string, rID int) {
253253

254254
// countDrawings provides a function to get drawing files count storage in the
255255
// folder xl/drawings.
256-
func (f *File) countDrawings() int {
257-
c1, c2 := 0, 0
256+
func (f *File) countDrawings() (count int) {
258257
f.Pkg.Range(func(k, v interface{}) bool {
259258
if strings.Contains(k.(string), "xl/drawings/drawing") {
260-
c1++
259+
count++
261260
}
262261
return true
263262
})
264263
f.Drawings.Range(func(rel, value interface{}) bool {
265264
if strings.Contains(rel.(string), "xl/drawings/drawing") {
266-
c2++
265+
count++
267266
}
268267
return true
269268
})
270-
if c1 < c2 {
271-
return c2
272-
}
273-
return c1
269+
return
274270
}
275271

276272
// addDrawingPicture provides a function to add picture by given sheet,

0 commit comments

Comments
 (0)