Bug 51172 - [Patch] Add GIF support for images
Summary: [Patch] Add GIF support for images
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2011-05-09 07:04 UTC by Stefan Stern
Modified: 2011-05-27 13:35 UTC (History)
0 users

Adds GIF-relation and GIF-constant (1.28 KB, application/octet-stream)
2011-05-09 07:04 UTC, Stefan Stern
Add testcase for GIF support (23.00 KB, application/octet-stream)
2011-05-09 07:40 UTC, Stefan Stern
Missing line in constants-array in XWPFPictureData (1.05 KB, application/octet-stream)
2011-05-09 12:32 UTC, Stefan Stern
Test-Document as separate attachement (20.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2011-05-16 06:42 UTC, Stefan Stern

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Stern 2011-05-09 07:04:51 UTC
Created attachment 26973 [details]
Adds GIF-relation and GIF-constant

Embedded GIF images are not supported in XWPF, the relations are not recognized. This patch adds the relation constants and enables POI to recognize GIF images.
Comment 1 Nick Burch 2011-05-09 07:09:24 UTC
Any chance of a very simple word file, say with a .gif and a .jpg image in it? That'd then be used in a unit test for this new functionality
Comment 2 Stefan Stern 2011-05-09 07:21:55 UTC
TestCase is in progress. Second patch about to come.
Comment 3 Stefan Stern 2011-05-09 07:40:41 UTC
Created attachment 26974 [details]
Add testcase for GIF support

This patch contains a small Word DOCX (created with Word 2010), that contains some Lorem-Ipsum text and a GIF image. 
Testcase checks if the GIF-part is there, if it is related with the document.xml part and if it was created properly according to the XWPFRelation constants settings.
Comment 4 Stefan Stern 2011-05-09 12:32:45 UTC
Created attachment 26978 [details]
Missing line in constants-array in XWPFPictureData

Sorry, missed to check the XWPFPictureData class when I created the patch. Here is the rest.
Comment 5 Nick Burch 2011-05-13 11:00:17 UTC
Any chance you could upload the test .docx file on its own? Only I can't get it out of the patch without it getting corrupted :/
Comment 6 Nick Burch 2011-05-13 11:06:10 UTC
Main patch applied, thanks. If you could upload just the sample file, I can do the test too
Comment 7 Stefan Stern 2011-05-16 06:42:36 UTC
Created attachment 27003 [details]
Test-Document as separate attachement

Here is the test-data file. Sorry for the delay.
Comment 8 Nick Burch 2011-05-27 13:35:48 UTC
Thanks, test added in r1128301.