summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-03-22 14:26:43 +0800
committerxuri <xuri.me@gmail.com>2019-03-22 14:37:59 +0800
commit677a22d99497fcc24135c949ab721d80ba5aa92a (patch)
treede688b94104b2e5c298d96855000bac44076f6b3 /picture.go
parent7d197c6d8963c4d7b6ba12b1f37c4bf1c9d0dade (diff)
resolve #366 fix image duplication
Diffstat (limited to 'picture.go')
-rw-r--r--picture.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/picture.go b/picture.go
index cacc453..d78bcdf 100644
--- a/picture.go
+++ b/picture.go
@@ -250,13 +250,21 @@ 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 {
- count := 0
+ c1, c2 := 0, 0
for k := range f.XLSX {
if strings.Contains(k, "xl/drawings/drawing") {
- count++
+ c1++
}
}
- return count
+ for rel := range f.Drawings {
+ if strings.Contains(rel, "xl/drawings/drawing") {
+ c2++
+ }
+ }
+ if c1 < c2 {
+ return c2
+ }
+ return c1
}
// addDrawingPicture provides a function to add picture by given sheet,