vcl/source/filter/itiff/itiff.cxx | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-)
New commits: commit 10ed9c82617a144c0597f37c0171e03103388f3f Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Aug 24 17:27:51 2025 +0200 Commit: Noel Grandin <noelgran...@gmail.com> CommitDate: Sun Aug 24 20:24:14 2025 +0200 BitmapEx->Bitmap in TIFFReader now that Bitmap supports transparency Change-Id: Iec71c0b845af0ca20f06508f0c7606a715f47f95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index bdf4999df514..0043e9ab9db5 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -245,7 +245,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) if (TIFFReadRGBAImageOriented(tif, w, h, raster.data(), ORIENTATION_TOPLEFT, 1)) { - Bitmap bitmap(Size(w, h), vcl::PixelFormat::N24_BPP); + Bitmap bitmap(Size(w, h), vcl::PixelFormat::N32_BPP); BitmapScopedWriteAccess access(bitmap); if (!access) { @@ -253,14 +253,6 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) break; } - AlphaMask bitmapAlpha(Size(w, h)); - BitmapScopedWriteAccess accessAlpha(bitmapAlpha); - if (!accessAlpha) - { - SAL_WARN("filter.tiff", "cannot create alpha " << w << " x " << h); - break; - } - /* ORIENTATION_TOPLEFT = 1 ORIENTATION_TOPRIGHT = 2 @@ -296,8 +288,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) break; } - access->SetPixel(y, dest, Color(r, g, b)); - accessAlpha->SetPixelIndex(y, dest, a); + access->SetPixel(y, dest, Color(ColorAlpha, a, r, g, b)); ++src; } } @@ -305,16 +296,13 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) raster.clear(); access.reset(); - accessAlpha.reset(); - - BitmapEx aBitmapEx(bitmap, bitmapAlpha); if (!bFuzzing) { switch (nOrientation) { case ORIENTATION_LEFTBOT: - aBitmapEx.Rotate(2700_deg10, COL_BLACK); + bitmap.Rotate(2700_deg10, COL_BLACK); break; default: break; @@ -337,10 +325,10 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) aMapMode = MapMode(MapUnit::MapCM, Point(0,0), Fraction(1/xres), Fraction(1/yres)); } } - aBitmapEx.SetPrefMapMode(aMapMode); - aBitmapEx.SetPrefSize(Size(w, h)); + bitmap.SetPrefMapMode(aMapMode); + bitmap.SetPrefSize(Size(w, h)); - AnimationFrame aAnimationFrame(aBitmapEx, Point(0, 0), aBitmapEx.GetSizePixel(), + AnimationFrame aAnimationFrame(BitmapEx(bitmap), Point(0, 0), bitmap.GetSizePixel(), ANIMATION_TIMEOUT_ON_CLICK, Disposal::Back); aAnimation.Insert(aAnimationFrame); }