vcl/source/filter/graphicfilter.cxx | 4 ++-- vcl/source/filter/jpeg/JpegWriter.cxx | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-)
New commits: commit 9f35fc45ca14a19ce165ea0dc53288e8ffdf9d6e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 27 09:15:05 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 27 11:42:29 2025 +0200 BitmapEx->Bitmap in vcl now that Bitmap supports transparency Change-Id: Ib60dd109e9a7c3e533db3725c760f5c8b8aeaca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190265 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 8f71e13f624a..d9a2802c25b7 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1728,11 +1728,11 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, std::u16string_vi } else if ( aFilterName.equalsIgnoreAsciiCase( EXP_PNG ) ) { - auto aBitmapEx = aGraphic.GetBitmapEx(); + auto aBitmap = aGraphic.GetBitmap(); vcl::PngImageWriter aPNGWriter( rOStm ); if ( pFilterData ) aPNGWriter.setParameters( *pFilterData ); - aPNGWriter.write( aBitmapEx ); + aPNGWriter.write( aBitmap ); if( rOStm.GetError() ) nStatus = ERRCODE_GRFILTER_IOERROR; diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index bd7b5f392ae1..4f8cb3c83aa0 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -202,14 +202,17 @@ bool JPEGWriter::Write( const Graphic& rGraphic ) // background color for alpha from the higher layers. Bitmap aGraphicBmp; if (rGraphic.GetType() == GraphicType::Bitmap) - aGraphicBmp = rGraphic.GetBitmapEx().GetBitmap(COL_WHITE); + { + aGraphicBmp = rGraphic.GetBitmap(); + aGraphicBmp.ReplaceTransparency(COL_WHITE); + } else - aGraphicBmp = rGraphic.GetBitmapEx().GetBitmap(); + aGraphicBmp = rGraphic.GetBitmap().CreateColorBitmap(); if ( mbGreys ) { if ( !aGraphicBmp.Convert( BmpConversion::N8BitGreys ) ) - aGraphicBmp = rGraphic.GetBitmapEx().GetBitmap(); + aGraphicBmp = rGraphic.GetBitmap().CreateColorBitmap(); } mpReadAccess = aGraphicBmp;