summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-03-20 16:52:33 +0800
committerxuri <xuri.me@gmail.com>2019-03-20 16:52:33 +0800
commit40ea8eb014c200c5ed8d81918ee56b0579aca324 (patch)
treea77370e074cc3b53f642b80bc3494ac35a25d17c /picture.go
parentbeff7b4f3c1c9a964d5f09181e1368d3a2b9a096 (diff)
resolve #360, fix axis parse issue when add / get pictures;
typo fixed and go test updated
Diffstat (limited to 'picture.go')
-rw-r--r--picture.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/picture.go b/picture.go
index f3463aa..cacc453 100644
--- a/picture.go
+++ b/picture.go
@@ -266,6 +266,8 @@ func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, width, he
col, row := MustCellNameToCoordinates(cell)
width = int(float64(width) * formatSet.XScale)
height = int(float64(height) * formatSet.YScale)
+ col--
+ row--
colStart, rowStart, _, _, colEnd, rowEnd, x2, y2 :=
f.positionObjectPixels(sheet, col, row, formatSet.OffsetX, formatSet.OffsetY, width, height)
content, cNvPrID := f.drawingParser(drawingXML)
@@ -469,7 +471,8 @@ func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string {
//
func (f *File) GetPicture(sheet, cell string) (string, []byte) {
col, row := MustCellNameToCoordinates(cell)
-
+ col--
+ row--
xlsx := f.workSheetReader(sheet)
if xlsx.Drawing == nil {
return "", []byte{}