@@ -598,15 +598,15 @@ func (f *File) getPicture(row, col int, drawingXML, drawingRelationships string)
598
598
cond2 := func (from * decodeFrom ) bool { return from .Col == col && from .Row == row }
599
599
cb := func (a * xdrCellAnchor , r * xlsxRelationship ) {
600
600
pic := Picture {Extension : filepath .Ext (r .Target ), Format : & GraphicOptions {}, InsertType : PictureInsertTypePlaceOverCells }
601
- if buffer , _ := f .Pkg .Load (strings . ReplaceAll ( r . Target , ".." , "xl" )); buffer != nil {
601
+ if buffer , _ := f .Pkg .Load (filepath . ToSlash ( filepath . Clean ( "xl/drawings/" + r . Target ) )); buffer != nil {
602
602
pic .File = buffer .([]byte )
603
603
pic .Format .AltText = a .Pic .NvPicPr .CNvPr .Descr
604
604
pics = append (pics , pic )
605
605
}
606
606
}
607
607
cb2 := func (a * decodeCellAnchor , r * xlsxRelationship ) {
608
608
pic := Picture {Extension : filepath .Ext (r .Target ), Format : & GraphicOptions {}, InsertType : PictureInsertTypePlaceOverCells }
609
- if buffer , _ := f .Pkg .Load (strings . ReplaceAll ( r . Target , ".." , "xl" )); buffer != nil {
609
+ if buffer , _ := f .Pkg .Load (filepath . ToSlash ( filepath . Clean ( "xl/drawings/" + r . Target ) )); buffer != nil {
610
610
pic .File = buffer .([]byte )
611
611
pic .Format .AltText = a .Pic .NvPicPr .CNvPr .Descr
612
612
pics = append (pics , pic )
@@ -756,14 +756,14 @@ func (f *File) getPictureCells(drawingXML, drawingRelationships string) ([]strin
756
756
cond := func (from * xlsxFrom ) bool { return true }
757
757
cond2 := func (from * decodeFrom ) bool { return true }
758
758
cb := func (a * xdrCellAnchor , r * xlsxRelationship ) {
759
- if _ , ok := f .Pkg .Load (strings . ReplaceAll ( r . Target , ".." , "xl" )); ok {
759
+ if _ , ok := f .Pkg .Load (filepath . ToSlash ( filepath . Clean ( "xl/drawings/" + r . Target ) )); ok {
760
760
if cell , err := CoordinatesToCellName (a .From .Col + 1 , a .From .Row + 1 ); err == nil && inStrSlice (cells , cell , true ) == - 1 {
761
761
cells = append (cells , cell )
762
762
}
763
763
}
764
764
}
765
765
cb2 := func (a * decodeCellAnchor , r * xlsxRelationship ) {
766
- if _ , ok := f .Pkg .Load (strings . ReplaceAll ( r . Target , ".." , "xl" )); ok {
766
+ if _ , ok := f .Pkg .Load (filepath . ToSlash ( filepath . Clean ( "xl/drawings/" + r . Target ) )); ok {
767
767
if cell , err := CoordinatesToCellName (a .From .Col + 1 , a .From .Row + 1 ); err == nil && inStrSlice (cells , cell , true ) == - 1 {
768
768
cells = append (cells , cell )
769
769
}
0 commit comments