Support Drawing in cell Read & Write #4677
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support for read & write of Image in Cell - Related to #4014
I must admit it was really complex to understand the relations between all xml (richData) files that have to be created / updated. I lost a lot of time comparing the structure with files edited in Excel and specifically figuring out the
metadata.xml
file had to be largely changed as soon as images are added in cells.This branch is based on #4664
This is:
Checklist:
Support for read and write of Image in Cell - Related to #4014
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->getInCellDrawingCollection()
. It's also possible to get the Drawing object from from the related Cell.The code is covered by tests and have been tested in real application - As shown bellow:

When I import the file with image inserted in the Cell, I have it now in $objWorksheet->getInCellDrawingCollection():