summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-11-25 10:23:31 +0100
committerMarco Cecchetti <mrcekets@gmail.com>2016-11-30 11:52:00 +0000
commitdbdf91f93ee975b1b9b6bfc6d9571e13ca0e750e (patch)
treed89c9ee4b58ebc3895b3d4c3d5f25caa71a6a0c2
parentde62a3ec928fb871ca8165a9349862778c2f3f1b (diff)
tdf#101458 - check PNG for adequate compression
Change-Id: I7131d3b721ebb4d47b0bb43f09fcb9767f8ac6d8 Reviewed-on: https://gerrit.libreoffice.org/31411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 34c448ce33de..73d923267a64 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -420,9 +420,10 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc
if ( !mbGroupIgnoreGDIMtfActions )
mCurrentGraphic = rGraphic;
}
- else if ( eType == GfxLinkType::NativePng )
+ else if ( eType == GfxLinkType::NativePng && mParaRects.size() >= 2 )
{
- mCurrentGraphic = rGraphic;
+ if ( rOutDevData.HasAdequateCompression(rGraphic, mParaRects[0], mParaRects[1]) )
+ mCurrentGraphic = rGraphic;
}
}
break;
@@ -805,7 +806,7 @@ bool PDFExtOutDevData::HasAdequateCompression( const Graphic &rGraphic,
{
bool bReduceResolution = false;
- assert( rGraphic.IsLink() && rGraphic.GetLink().GetType() == GfxLinkType::NativeJpg );
+ assert( rGraphic.IsLink() && (rGraphic.GetLink().GetType() == GfxLinkType::NativeJpg || rGraphic.GetLink().GetType() == GfxLinkType::NativePng));
// small items better off as PNG anyway
if ( rGraphic.GetSizePixel().Width() < 32 &&