Page 1 of 1

Improvement BinaryPartAbstractImage

PostPosted: Thu Oct 06, 2011 10:49 pm
by y.rolland
Hi Jason,

I have finished the interface for Series in graphics but I need to make some tests (I was really busy).

I am currently working on images and I have seen that we must give an array of bytes in order to add pictures. So I provide you a little patch which allows user to give directly the image path. Then, image is not loaded in memory and there is an improvement of time for adding an image (divide time by 10).

I have overloaded the method createImagePart with a filePath instead of a byte Array. This method call createImagePartFromFilePath the copy of your method but without the memory loading. I also needed to modify ensureFormatIsSupported (the behavior is different if the image is loaded or not).
I have tested it with common images but not with EPS or PDF images (i have installed imageMagick but the command "imconvert" doesn't work??).

Tell me if you are interested in this changes (or maybe there was already a method which did it??).

Best regards.

Re: Improvement BinaryPartAbstractImage

PostPosted: Fri Oct 07, 2011 2:38 pm
by jason
Thanks for this.

I'm assuming it is contributed on the basis of http://www.docx4java.org/docx4j/docx4j_ ... butor.docx and have applied it as http://www.docx4java.org/trac/docx4j/changeset/1679

I refactored it a bit. Please see/check http://www.docx4java.org/trac/docx4j/changeset/1680

cheers .. Jason