-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File corrupted after writer creation and save #4179
Comments
Thank you for the sample file. Problem confirmed. It also happens with PhpSpreadsheet 2.2.0, so probably is not caused by recent changes. |
No indeed, I tried to update to the last version to see if the problem was solved but no. |
It might take some time to figure this out. One thing that I see in your spreadsheet that I don't see in most others is the use of SVG images, for which we have no formal support. I'm not saying this is causing the problem, but it would be useful to see what happens without them. Is it possible for you to create a copy of your spreadsheet that uses PNG images in place of SVG, and see if the same problem occurs? |
Having nothing to do with SVG, there appears to be a duplicate entry for PNG in ContentTypes. I think that is the reason Xlsx thinks the file is corrupt. Researching ... |
Yes, that's it. Your sheet has a background image, and the code is not properly accounting for the image's extension already being defined in ContentTypes. Background images are fairly unusual, which is probably why this problem hasn't arisen before. The SVG images will be dropped from the copy, but are otherwise not the source of any problems. Expect a fix in a few days. |
Fix PHPOffice#4179. Sheet has a background image, and the code is not properly accounting for the image's extension already being defined in ContentTypes, resulting in what Excel thinks is a corrupt file.
If you can test against PR 4180, please do so. |
Perfect, it works ! Thank you for your quick fix ! |
This is:
What is the current behavior?
File is corrupted after IOFactory::createWriter and save
The text was updated successfully, but these errors were encountered: