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).
This change addresses this issue among others: https://gerrit.libreoffice.org/6369
I think this issue is a duplicate of Bug 52226. I Hope you comments about saving code could help the devs. *** This bug has been marked as a duplicate of bug 52226 ***