https://issues.apache.org/bugzilla/show_bug.cgi?id=46627





--- Comment #5 from David <[email protected]>  2009-02-09 04:58:50 PST ---
You are correct, PictureLengthZero.ppt exposes the problem. Simply adding any
picture, like the following code does, should result in an invalid image in the
resulting ppt:

   SlideShow ppt = new SlideShow( new ByteArrayInputStream( readFile( args[ 0 ]
) ) );

   int index = ppt.addPicture( readFile( args[ 1 ] ), Picture.PNG );
   Picture picture = new Picture( index );
   ppt.getSlides()[0].addShape( picture );

   ByteArrayOutputStream result = new ByteArrayOutputStream();
   ppt.write( result );

   FileOutputStream os = new FileOutputStream( "output.ppt" );
   os.write( result.toByteArray() );
   os.close();

readFile is a simple function that returns the bytes contained in a file. After
applying the patch this works for me.


bye, David.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to