Kaydet (Commit) ad0edc18 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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/20461Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 33ff1ba8
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment