diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-11-25 10:23:31 +0100 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-11-30 11:54:23 +0000 |
commit | fed7de57d23b43f0a0cb2bcf5f0fbefe5852de2e (patch) | |
tree | 0a80e4c2516376ed9530b1ba1f1569d6f6b46474 | |
parent | 92a302146e626c877c493086ff518fde70c3141b (diff) |
tdf#101458 - check PNG for adequate compression
Change-Id: I7131d3b721ebb4d47b0bb43f09fcb9767f8ac6d8
Reviewed-on: https://gerrit.libreoffice.org/31409
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
-rw-r--r-- | vcl/source/gdi/pdfextoutdevdata.cxx | 7 |
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 && |