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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

GitBox

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:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

GitBox

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:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

GitBox
In reply to this post by GitBox

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:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]