You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by GitBox <gi...@apache.org> on 2021/02/06 15:29:19 UTC

[GitHub] [poi] MariusVolkhart opened a new pull request #225: Add the ability to edit HSLFPictureData contents

MariusVolkhart opened a new pull request #225:
URL: https://github.com/apache/poi/pull/225


   Hey Devs, I'd appreciate a review of the following code for any obvious flaws you see with this approach of enabling picture editing in `HSLFPictureData`. In my initial testing I haven't seen any issues, but more eyes are always good.
   
   Pictures can now be edited by calling HSLFPictureData#setData(byte[]). The byte[] should contain the image data as an image viewer might read it.
   
   To enable this functionality, a tighter coupling between the EscherBSERecords of the slideshow and the HSLFPictureData was required. This ensures that changes in image data size are accurately recorded in the records.
   
   In the course of coupling the records and the HSLFPictureData, various scenarios arose where a mapping of records to pictures was non-trivial. Accordingly, the HSLFSlideShowImpl#matchPicturesAndRecords(...) function was added to perform a more sophisticated matching pass. This function is heavily exercised by org.apache.poi.hslf.usermodel.TestBugs.testFile[5] and PPTX2PNG.render[2], as well as the new TestPictures#testSlideshowWithIncorrectOffsets().


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] MariusVolkhart commented on pull request #225: Add the ability to edit HSLFPictureData contents

Posted by GitBox <gi...@apache.org>.
MariusVolkhart commented on pull request #225:
URL: https://github.com/apache/poi/pull/225#issuecomment-776197161


   @kiwiwings I added a test. It uses a premade encrypted slideshow, but otherwise does what you described.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] asfgit closed pull request #225: Add the ability to edit HSLFPictureData contents

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #225:
URL: https://github.com/apache/poi/pull/225


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] kiwiwings commented on pull request #225: Add the ability to edit HSLFPictureData contents

Posted by GitBox <gi...@apache.org>.
kiwiwings commented on pull request #225:
URL: https://github.com/apache/poi/pull/225#issuecomment-774511158


   Hi Marius,
   I've just quickly browsed the changes.
   Maybe we should add a small testcase with encryption enabled, i.e. create encrypted hslf with an image > save/reopen > add / edit picture > reopen > compare checksum. I think when reading the pictures, the stream is cached, but a test wouldn't hurt.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org