diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-11-25 10:23:31 +0100 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-12-13 11:31:28 +0000 |
commit | 0c937f5d692477371bf2fe367a710f0899e36c33 (patch) | |
tree | 26eae5b95329d4648316a6da71856b574097123d | |
parent | 70acd9855b5095e18daede7661a8cfc36bd3544f (diff) |
tdf#101458 - check PNG for adequate compression
Change-Id: I7131d3b721ebb4d47b0bb43f09fcb9767f8ac6d8
Reviewed-on: https://gerrit.libreoffice.org/31190
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
(cherry picked from commit d96781383747299443f61e027285d54ffd5bc5c8)
Reviewed-on: https://gerrit.libreoffice.org/31412
(cherry picked from commit 1fd5c8080c47e75fff4aa377540ced29142da146)
Reviewed-on: https://gerrit.libreoffice.org/31605
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: jan iversen <jani@documentfoundation.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
-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 1a58c90a73dc..811d61849738 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 == GFX_LINK_TYPE_NATIVE_PNG ) + else if ( eType == GFX_LINK_TYPE_NATIVE_PNG && 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() == GFX_LINK_TYPE_NATIVE_JPG ); + assert( rGraphic.IsLink() && (rGraphic.GetLink().GetType() == GFX_LINK_TYPE_NATIVE_JPG || rGraphic.GetLink().GetType() == GFX_LINK_TYPE_NATIVE_PNG)); // small items better off as PNG anyway if ( rGraphic.GetSizePixel().Width() < 32 && |