You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/11/28 14:06:54 UTC

DO NOT REPLY [Bug 52255] New: RFE: XWPFPictureData should allow registration of new image formats

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

             Bug #: 52255
           Summary: RFE: XWPFPictureData should allow registration of new
                    image formats
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
        AssignedTo: dev@poi.apache.org
        ReportedBy: pslaby@hotmail.com
    Classification: Unclassified


I use XWPF to create docx files. In addition to the image file formats
hardcoded in XWPFPictureData, I need to be able to insert tiff images and
possibly others into it. The hardcoded array of known image formats is not
complete. Best would be if XWPFPictureData provides an API for listing known
formats and adding new ones. Up to 3.8 beta 3 I used to create the image
reference by myself and add it to the pictures List, but in 3.8 beta 4 the
pictures field is package private in XWPFHeaderFooter.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52255] RFE: XWPFPictureData should allow registration of new image formats

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52255

pslaby@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from pslaby@hotmail.com 2011-11-28 14:08:38 UTC ---
Personally, I am mainly missing tiff. From formats listed at
http://support.microsoft.com/kb/320314/en-us the following are missing:
BMP
PCX
TIFF
DXF
CGM
CDR
EPS

But I am not sure whether it is possible to enhance the available formats by
installing an image format filter into Word.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52255] RFE: XWPFPictureData should allow registration of new image formats

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52255

--- Comment #4 from pslaby@hotmail.com 2011-11-29 14:06:38 UTC ---
Created attachment 27999
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27999
Sample with various image formats

I have tried to insert a Windows Bitmap (BMP), Tiff, Encapsulated Postscript
(EPS), WordPerfect Graphics (WPG) and Compressed Enhanced Metafile (EMZ) in
Word 2007, the result is attached. My version of Word did not accept PCX. I was
not able to find or produce examples of the other image formats originally
listed in my post. 

It seems that, with the exception of tiff, Word immediately converts the images
to emf or png. Tiff is the only one that remains as tiff in the docx file and
(probably) the only missing in XWPFPictureData constants (<Relationship
Id="rId5"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
Target="media/image2.tiff"/>).

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52255] RFE: XWPFPictureData should allow registration of new image formats

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52255

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Nick Burch <ni...@alfresco.com> 2011-11-28 17:50:37 UTC ---
Any chance you could upload a file with all those image types in it? That'd
make the work of identifying the details of the types very quick!

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52255] RFE: XWPFPictureData should allow registration of new image formats

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52255

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Yegor Kozlov <ye...@dinom.ru> 2012-02-26 06:38:55 UTC ---
As of r1293748, POI supports TIFF, EPS, BMP and WPG images. The fix applies to
all OOXML modules: XSSF, XWPF and XSLF.
The full list of supported formats is
emf|wmf|pict|jpeg|png|dib|gif|tiff|eps|bmp|wpg. DXF, CGM and CDR are not
supported by MS Office 2007 / 2010 by default, you have to install an image
filter to import those formats and internally MS Office converts them to either
PNG or EMF. So if you need to import a file from Autocad or CorelDraw, convert
it first to one of the supported formats by POI.

> It seems that, with the exception of tiff, Word immediately converts the images
> to emf or png.

yes, MS Office does so, but if you programmatically insert images in a raw form
then MS Office is fine to show them. I guess internally MS Office  handles all
vector formats as EMF/WMF. Other formats are converted either when inserting or
on the fly.  

Yegor

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52255] RFE: XWPFPictureData should allow registration of new image formats

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52255

pslaby@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52255] RFE: XWPFPictureData should allow registration of new image formats

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52255

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
         OS/Version|                            |All

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-11-28 13:42:56 UTC ---
We need to take care around IDs, relation types, content types etc. However,
these are generally known constants

I think the proper fix is probably just to identify all the other image types
that can be supported, and add these in to the constants list

Are you able to identify which ones we're missing, and supply the appropriate
types?

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org