| Summary: |
FILESAVE: docx: JPG images not saved on export |
| Product: |
LibreOffice
|
Reporter: |
Jacobo Aragunde Pérez <jaragunde> |
| Component: |
Writer | Assignee: |
Jacobo Aragunde Pérez <jaragunde> |
| Status: |
RESOLVED
DUPLICATE
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
medium
|
CC: |
barta
|
| Version: |
4.2.0.0.alpha0+ Master | |
|
| Hardware: |
Other | |
|
| OS: |
All | |
|
| Whiteboard: |
|
|
i915 platform:
|
|
i915 features:
|
|
| Attachments: |
Test case
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 87822 [details] Test case The attached file contains a JPG image embedded into a document as a Draw object. When you export this document to docx the image itself is not saved: if you unzip the docx file you will see that /word/media/ contains a 0-byte file called "image1". Why is this happening? Look at the code that should save the image file: oox/source/export/vmlexport.cxx:559 if ( rProps.GetOpt( ESCHER_Prop_fillBlip, aStruct ) && m_pTextExport) { SvMemoryStream aStream; int nHeaderSize = 25; // The first bytes are WW8-specific, we're only interested in the PNG aStream.Write(aStruct.pBuf + nHeaderSize, aStruct.nPropSize - nHeaderSize); aStream.Seek(0); Graphic aGraphic; GraphicConverter::Import(aStream, aGraphic, CVT_PNG); OUString aImageId = m_pTextExport->GetDrawingML().WriteImage( aGraphic ); pAttrList->add(FSNS(XML_r, XML_id), OUStringToOString(aImageId, RTL_TEXTENCODING_UTF8)); } As you can see, CVT_PNG is hard-wired here. If you had used a PNG image it would have been properly saved but the image wouldn't appear when you open back that saved .docx that's a different bug anyway ;) (probably #65836).