https://bugs.freedesktop.org/show_bug.cgi?id=70616
Priority: medium Bug ID: 70616 Assignee: libreoffice-bugs@lists.freedesktop.org Summary: FILESAVE: docx: JPG images not saved on export Severity: normal Classification: Unclassified OS: All Reporter: jaragu...@igalia.com Hardware: Other Status: NEW Version: 4.2.0.0.alpha0+ Master Component: Writer Product: LibreOffice Created attachment 87822 --> https://bugs.freedesktop.org/attachment.cgi?id=87822&action=edit 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). -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs