[Libreoffice-commits] core.git: Branch 'distro/vector/vector-5.4' - 2 commits - filter/source vcl/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 22 09:31:23 UTC 2020


 filter/source/pdf/pdffilter.cxx    |    2 +-
 vcl/source/gdi/pdfwriter_impl2.cxx |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 0fcfda2be3681f4e6955bdec1e042304ed189e23
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jan 21 16:55:08 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jan 22 10:00:02 2020 +0100

    PDF export: don't ignore FilterData specified by UNO clients
    
    The data was given to the PDF filter, but then we stopped iterating
    right after finding our output stream. Seems this was always like this,
    ever since commit 4111b430a0a7954416ff95794a8ffb8fbc4472e3 (#101570#:
    added pdf filter, 2002-08-13).
    
    (cherry picked from commit 3b9797671ce49f53b2c583c9201c348b55b10c96)
    
    [ Testcase not backported, pdfium is too old on this branch. ]
    
    Conflicts:
            filter/source/pdf/pdffilter.cxx
            vcl/qa/cppunit/pdfexport/pdfexport.cxx
    
    Change-Id: If26661935c22a7b7959fda5f92b4d50b15f13a35

diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 2a32408bb0c3..7396b96b88cc 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -48,7 +48,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
     Reference< task::XStatusIndicator > xStatusIndicator;
     Reference< task::XInteractionHandler > xIH;
 
-    for ( sal_Int32 i = 0 ; ( i < nLength ) && !xOStm.is(); ++i)
+    for ( sal_Int32 i = 0 ; ( i < nLength ); ++i)
     {
         if ( pValue[ i ].Name == "OutputStream" )
             pValue[ i ].Value >>= xOStm;
commit b9896d177be27b9c91402e211cac05d6a8b35c2d
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Jan 20 17:53:25 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jan 21 12:24:20 2020 +0100

    PDF export: skip pointless downsampling for very small images
    
    Regression from commit b6588bd7c831ce88a29131ca7ea8d3f3e082564e (Reduce
    image resolution by default in PDF Export, 2014-03-02) the problem is
    that in case you have small enough bitmaps, then these used to look
    OK at reasonable zoom levels, but now we intentionally scale down
    bitmaps by default.
    
    That makes little sense for tiny images, do this only for large ones.
    
    (cherry picked from commit b894ec7fadb8ca6bf0b33fa9eee4b9303e8161d4)
    
    [ Testcase not backported, pdfium is too old on this branch. ]
    
    Conflicts:
            vcl/qa/cppunit/pdfexport/pdfexport.cxx
            vcl/source/gdi/pdfwriter_impl2.cxx
    
    Change-Id: Iff15325b842b47d9285a7c0f83f402897498392d

diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index bf039f142d58..26cfe00c9b27 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -104,11 +104,13 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
             bIsPng = (eType == GfxLinkType::NativePng);
         }
 
-        if( i_rContext.m_nMaxImageResolution > 50 )
+        // Do not downsample images smaller than 50x50px.
+        const Size      aBmpSize( aBitmapEx.GetSizePixel() );
+        if (i_rContext.m_nMaxImageResolution > 50 && aBmpSize.getWidth() > 50
+                && aBmpSize.getHeight() > 50)
         {
             // do downsampling if necessary
             const Size      aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MapUnit::MapTwip ) );
-            const Size      aBmpSize( aBitmapEx.GetSizePixel() );
             const double    fBmpPixelX = aBmpSize.Width();
             const double    fBmpPixelY = aBmpSize.Height();
             const double    fMaxPixelX = aDstSizeTwip.Width() * i_rContext.m_nMaxImageResolution / 1440.0;


More information about the Libreoffice-commits mailing list