summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2015-12-07 23:40:39 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-12-08 01:03:31 +0000
commitad0edc184792f3aa3f72e8d4ec8b76c3d1bf8479 (patch)
treefa2b8a138b142bc274bac669563bda6fe7c6b008
parent33ff1ba8583f9461ddf5b773bee6c1974c21afbe (diff)
Related: tdf#71622 compress more gfx in odf streams
Except for jpeg and png, most natively-stored image fileformats compress rather well with zlib. adding a number of vector and pixel formats. Change-Id: I97407a98f620520b0d11552911d2339bf004dc5b Reviewed-on: https://gerrit.libreoffice.org/20461 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--svx/source/xml/xmlgrhlp.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index da12446b6bb3..58cd9b4c7bd5 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -534,7 +534,33 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName,
xProps->setPropertyValue( "MediaType", aAny );
}
- const bool bCompressed = aMimeType.isEmpty() || aMimeType == "image/tiff" || aMimeType == "image/svg+xml";
+ // picture formats that actuall _do_ benefit from zip
+ // storage compression
+ // .svm pics gets compressed via ZBITMAP old-style stream
+ // option below
+ static const char* aCompressiblePics[] =
+ {
+ "image/svg+xml",
+ "image/x-wmf",
+ "image/tiff",
+ "image/x-eps",
+ "image/bmp",
+ "image/x-pict"
+ };
+
+ bool bCompressed = aMimeType.isEmpty();
+ if( !bCompressed )
+ {
+ for( size_t i = 0; i < SAL_N_ELEMENTS(aCompressiblePics); ++i )
+ {
+ if( aMimeType.equalsIgnoreAsciiCaseAscii(aCompressiblePics[i]) )
+ {
+ bCompressed = true;
+ break;
+ }
+ }
+ }
+
aAny <<= bCompressed;
xProps->setPropertyValue( "Compressed", aAny );