From 0aa15106947965bdae9daae7571a4a3f569bf32d Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 11 Jul 2020 02:31:02 +0800 Subject: update docs and improve compatibility --- picture.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'picture.go') diff --git a/picture.go b/picture.go index 0e9e3bb..c7f6e27 100644 --- a/picture.go +++ b/picture.go @@ -549,11 +549,12 @@ func (f *File) getPictureFromWsDr(row, col int, drawingRelationships string, wsD for _, anchor = range wsDr.TwoCellAnchor { if anchor.From != nil && anchor.Pic != nil { if anchor.From.Col == col && anchor.From.Row == row { - drawRel = f.getDrawingRelationships(drawingRelationships, - anchor.Pic.BlipFill.Blip.Embed) - if _, ok = supportImageTypes[filepath.Ext(drawRel.Target)]; ok { - ret, buf = filepath.Base(drawRel.Target), f.XLSX[strings.Replace(drawRel.Target, "..", "xl", -1)] - return + if drawRel = f.getDrawingRelationships(drawingRelationships, + anchor.Pic.BlipFill.Blip.Embed); drawRel != nil { + if _, ok = supportImageTypes[filepath.Ext(drawRel.Target)]; ok { + ret, buf = filepath.Base(drawRel.Target), f.XLSX[strings.Replace(drawRel.Target, "..", "xl", -1)] + return + } } } } -- cgit v1.2.1