-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Support for read of Image in Cell #4664
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
base: master
Are you sure you want to change the base?
Conversation
You will need to fix the phpcs, php-cs-fixer, and phpstan errors. After those, the unit test errors. After that, you need some formal unit tests. Finally, you've addressed only the read side. It isn't absolutely required, but I would be happier with a change which addressed both reading and writing (which I will admit is probably much harder). I do not know if TYPE_DRAWING is a good idea or not. I'll think about it when this PR is in better shape. |
It looks like you have only one test failure, but it was caught during multiple tests. When a formula has an array result which spills into cells which already have values, Excel also uses the |
Not sure why the coverage decreased (-0.04%) as I created a Unit Test that cover all the code that have been added. I'm not able to see the details https://coveralls.io/builds/75720737/source?filename=src%2FPhpSpreadsheet%2FReader%2FXlsx.php#L791 |
Thank you for adding the tests. Decreasing code coverage is not necessarily a reason for us to proceed with a change. However, in this case, it is a showstopper. The Coveralls report shows that most of the code you added is not being exercised by the unit test suite. In particular:
So, either the bulk of your new code is unneeded, or it is inadequately tested. Please see what you can do about that. I have some ideas about how to proceed once you've attended to this. |
Ok I forgot the Test suffix in |
Support for read of Image in Cell - Related to #4014
This is:
Checklist:
Why this change is needed?
When an image is inserted in a cell in an XLSX document, PhpSpreadsheet is currently not able to read it. This PR allow to collect those images in order to find them when calling $objWorksheet->getDrawingCollection()
The code have been tested - As shown bellow:

When I import the file with image inserted in the Cell, I have it now in $objWorksheet->getDrawingCollection():
As an improvement, maybe we should introduce a DataType::TYPE_DRAWING and adapt the code accordingly to allow the user to get the Drawing object when calling getValue() on the cell?