Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Created Unassigned: ExcelPicture.SetPosition(int Row, int RowOffsetPixels, int Column, int ColumnOffsetPixels) offset problem [15391]

$
0
0
If you add an image with too much negative offset, you get a unfortunate bug that only shows up if you change the excel document later on.

To reproduce, run this
```
ExcelPackage pck = new ExcelPackage();
ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Test");
ExcelPicture picture = ws.Drawings.AddPicture("", Image.FromFile(Path.GetFullPath("..\\..\\Clown-Tux-icon.png")));
picture.SetPosition(10, -100, 10, -100);
pck.File = new FileInfo(Path.GetFullPath("..\\..\\test.xlsx"));
pck.Save();
```
* Open document in excel
* Yay it works! or does it?
* Enter a number like 1 somewhere
* Save and close excel
* Open same document and an error appears

> We found a problem with some content in 'test.xlsx'. Do you want us to try recover as much as we can? If you trust the source of this workbook, click Yes
![Image](http://i.imgur.com/kuqOuMZ.png)


I think it would be better if this was detected earlier and gave me a runtime ArgumentException or similar if the offset was too negative. Do we need to allow negative offset at all?

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>