vcl/source/gdi/pdfwriter_impl.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 4925a905232f1bbfe6034fb3e6d33a61e46d0229
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Sat Jan 25 11:12:12 2025 -0500
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Mon Jan 27 03:47:10 2025 +0100

    tdf#164223 invert alpha mask for JPEG images
    
    Change-Id: I6f1070b8cc38a56168ea5248fa4b011f04d83c71
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180746
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    Tested-by: Jenkins
    (cherry picked from commit 5e03f4d40c14cc79b1f3f790955196a31eec5d3c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180748
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index f41309685cc1..06dc45140c7f 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -9282,7 +9282,11 @@ void PDFWriterImpl::writeJPG( const JPGEmit& rObject )
     {
         BitmapEmit aEmit;
         aEmit.m_nObject = nMaskObject;
-        aEmit.m_aBitmap = BitmapEx( rObject.m_aAlphaMask.GetBitmap(), 
rObject.m_aAlphaMask );
+        // tdf#164223 invert alpha mask for JPEG images
+        AlphaMask aAlpha = rObject.m_aAlphaMask;
+        if( aAlpha.hasAlpha() )
+            aAlpha.Invert();
+        aEmit.m_aBitmap = BitmapEx( rObject.m_aAlphaMask.GetBitmap(), aAlpha );
         writeBitmapObject( aEmit, true );
     }
 

Reply via email to