-
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
Xlsx image background in comments #1547 #2422
Xlsx image background in comments #1547 #2422
Conversation
# Conflicts: # CHANGELOG.md
Two questions:
|
For the php-cs-fixer problems, you have redundant declarations for return type in hasBackgroundImage and getBackgroundImage, and for the parameter in setBackgroundImage. Remove the docBlock declarations, and keep the declarations in the function declaration. For the documentation updates, the docs are in directory /docs. They are in markdown format. You just need to edit them as plaintext. |
When you add the new element backgroundImage to the Comment class, you need to make sure that it takes part in the calculation for getHashCode. |
Thanks for answers. I'll try to fix it. |
This fixes #1547. |
63aed78
to
d90d319
Compare
Ok, all checks passed. How i can link this PR and issue #1547? Or I can't do this? |
To link your PR to the issue, edit your commit message to include You do not need to keep merging master into your PR. Your change will require some time to review. It is complex, and, unfortunately, hits some of the hardest to understand code in the project, especially in Reader/Xlsx. There are 2 much simpler changes (#2416 and #2423) which already deal with problems with reading and writing image files; these may be applicable to how you are approaching this problem. I will be merging those in the near future, after which I will start on yours in earnest. |
Ok, thank you. |
For your tests, it is not true that "The only thing we need is to ensure the file is loaded without exception." There are many assertions you can and should be making - do the expected cells have comments, do the comments have images, are the images the right type and size, etc. FWIW, my preliminary testing indicates that your testBuildWithDifferentImageFormats is probably behaving as expected, but I'm not so sure about your testSaveLoadWithDrawingInComment. When I use your code to load your test file and save it under a new name, I see a comment with an image, but the image is just a black background - there doesn't seem to be a media directory, which would hold the image, in the output file. |
Ok, I will fix it and add test soon. |
…ng image sizes from zip, set image type
3124cc0
to
77414af
Compare
…s' into XLSX-Image-Background-In-Comments
77414af
to
22f2d89
Compare
…s' into XLSX-Image-Background-In-Comments
@oleibman please check it again, i added tests and fix. |
Getting close. The result for testSaveLoadWithDrawingInComment now looks correct. In testBuildWithDifferentImageFormats, there is no "tiff" image in the output file by design. Since you are expecting it to fail when you try to add a tiff image, your try block should add a self::fail statement: try {
$comment->set...
self::fail('Should throw exception when attempting to add tiff');
} catch (... I need you to add tests after the write/reload sequences as well, essentially the same tests as you made before the write. This will help confirm that read and write work correctly. |
Is it ok now? ) |
Yes, I believe it is okay now. I do not have time to merge it at the moment, but some time in the next day or two. Scrutinizer reports some problems. For documentation purposes, here is why I am ignoring them:
|
Thank you for your contribution. |
I noticed, too late, that PR PHPOffice#2422 updated the Release 1.20 section of change log because there was no Unreleased section. Created the missing section, moved the comment for 2422, and added the rest of the changes that have taken place since 1.20.
I noticed, too late, that PR #2422 updated the Release 1.20 section of change log because there was no Unreleased section. Created the missing section, moved the comment for 2422, and added the rest of the changes that have taken place since 1.20.
Add a picture to the background of the comment. Supports four image formats: png, jpeg, gif, bmp. A method for changing the size of a comment to the size of an image.
Checklist:
Why this change is needed?