diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-03-12 16:30:55 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-03-13 09:09:11 +0100 |
commit | 9034207b3019e395390e5aa9eaa1a11ca81c63b5 (patch) | |
tree | 177380d97ccbe280bea71f88a96e9e2c5aa29853 /sw/qa | |
parent | fb04780cf8523ad4e900ae8b9cecbe7a2697a12a (diff) |
sw XHTML export: always write images as PNG in ReqIF mode
JPG image would have to be JPG + PNG fallback, at which point it's
easier to just write PNG.
Change-Id: I6e4f0759244d29735fdcda8e050d198f118c737d
Reviewed-on: https://gerrit.libreoffice.org/51151
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/htmlexport/data/reqif-jpg-img.xhtml | 4 | ||||
-rw-r--r-- | sw/qa/extras/htmlexport/data/reqif-ole-img.jpg | bin | 0 -> 696 bytes | |||
-rw-r--r-- | sw/qa/extras/htmlexport/htmlexport.cxx | 12 |
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlexport/data/reqif-jpg-img.xhtml b/sw/qa/extras/htmlexport/data/reqif-jpg-img.xhtml new file mode 100644 index 000000000000..da7276192a31 --- /dev/null +++ b/sw/qa/extras/htmlexport/data/reqif-jpg-img.xhtml @@ -0,0 +1,4 @@ +<reqif-xhtml:div><reqif-xhtml:br/> + <reqif-xhtml:img data="reqif-ole-img.jpg" type="image/jpeg">OLE Object</reqif-xhtml:img> +</reqif-xhtml:div> + diff --git a/sw/qa/extras/htmlexport/data/reqif-ole-img.jpg b/sw/qa/extras/htmlexport/data/reqif-ole-img.jpg Binary files differnew file mode 100644 index 000000000000..ca9183e9d308 --- /dev/null +++ b/sw/qa/extras/htmlexport/data/reqif-ole-img.jpg diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 5c8f5cfaf5f1..289fcb2a26d7 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -424,6 +424,18 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfPngImg, "reqif-png-img.xhtml") CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:object") != -1); } +DECLARE_HTMLEXPORT_TEST(testReqIfJpgImg, "reqif-jpg-img.xhtml") +{ + SvStream* pStream = maTempFile.GetStream(StreamMode::READ); + CPPUNIT_ASSERT(pStream); + pStream->Seek(STREAM_SEEK_TO_END); + sal_uInt64 nLength = pStream->Tell(); + pStream->Seek(0); + OString aStream(read_uInt8s_ToOString(*pStream, nLength)); + // This was image/jpeg, JPG was not converted to PNG in ReqIF mode. + CPPUNIT_ASSERT(aStream.indexOf("type=\"image/png\"") != -1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |