Corrupt file when image added.


Without changing anything Excel now claims that the XLSX files created by EPPlus are corrupted as soon as an image has been added. This happened in Excel 2007 and Excel 2016 on two different machines. I opened the zipped XLSX and everything seems to look fine (image is in media folder). Here is the message after the repair attempt: "Reparierte Datensätze: Zeichnung von /xl/drawings/drawing2.xml-Part (Zeichnungsform)"(unfortunately only in German). The image is a JPG. Did MS drop JPG as an allowed format? See generated file as attachment.

file attachments


needfulthing wrote Jul 4 at 3:17 PM

Note: I just changed my code to include bitmaps instead of jpgs and the files are fine again.

needfulthing wrote Jul 4 at 3:27 PM

Funny enough the images are still saved as jpg files in the XLSX zip (/_xl/media) folder. That's quite confusing.