diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2016-10-22 20:06:26 +0200 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2016-10-25 11:29:12 +0000 |
commit | 88fb9d8f0aae0030fac75156f78818affae4298f (patch) | |
tree | 4f4567fd2ffa1d1d8faf660f24443397fa1b66df /vcl | |
parent | 799a3a7915e6285c8072f92c63ba7149223ac443 (diff) |
tdf#99723: target ratio must be reached
to be sure we can avoid decompressing/recompressing
Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=76ec54e8c9f3580450bca85236a4f5af0c328588
Change-Id: Iacd7b2419ea85756f936b17f04c4e495d15e5b81
Reviewed-on: https://gerrit.libreoffice.org/30163
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/pdfextoutdevdata.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 2223ca37ad9e..34c448ce33de 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -830,14 +830,18 @@ bool PDFExtOutDevData::HasAdequateCompression( const Graphic &rGraphic, { 80, 1500 }, { 75, 1700 } }; sal_Int32 nTargetRatio = 10000; + bool bIsTargetRatioReached = false; for (auto & rRatio : aRatios) { if ( mnCompressionQuality > rRatio.mnQuality ) + { + bIsTargetRatioReached = true; break; + } nTargetRatio = rRatio.mnRatio; } - return nCurrentRatio > nTargetRatio; + return ((nCurrentRatio > nTargetRatio) && bIsTargetRatioReached); } } |