[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/source
Marco Cecchetti
marco.cecchetti at collabora.com
Wed Nov 30 11:53:26 UTC 2016
vcl/source/gdi/pdfextoutdevdata.cxx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 1fd5c8080c47e75fff4aa377540ced29142da146
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Fri Nov 25 10:23:31 2016 +0100
tdf#101458 - check PNG for adequate compression
Change-Id: I7131d3b721ebb4d47b0bb43f09fcb9767f8ac6d8
Reviewed-on: https://gerrit.libreoffice.org/31190
Reviewed-by: Marco Cecchetti <mrcekets at gmail.com>
Tested-by: Marco Cecchetti <mrcekets at gmail.com>
(cherry picked from commit d96781383747299443f61e027285d54ffd5bc5c8)
Reviewed-on: https://gerrit.libreoffice.org/31412
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 1a58c90..811d618 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 &&
More information about the Libreoffice-commits
mailing list