avmedia/source/qt6/QtFrameGrabber.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 99ab2178c9d8f316811cc3c12d9c6bdc704ba055
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 22 08:44:14 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Apr 22 10:26:15 2025 +0200

    qt6 avmedia: Adjust code to PngImageReader changes
    
    Adjust the code after
    
        commit 70162a33fde729998e4d9c7558f3634352738772
        Date:   Tue Apr 15 14:17:21 2025 +0900
    
            vcl: Introduce ImportOutput to return BitmapEx or Animation
    
    to address the following build failure for the --enable-qt6 build:
    
        
/home/michi/development/git/libreoffice/avmedia/source/qt6/QtFrameGrabber.cxx:36:13:
 error: no matching member function for call to 'read'
           36 |     aReader.read(aGraphic);
              |     ~~~~~~~~^~~~
        
/home/michi/development/git/libreoffice/include/vcl/filter/PngImageReader.hxx:58:10:
 note: candidate function not viable: no known conversion from 'Graphic' to 
'BitmapEx &' for 1st argument
           58 |     bool read(BitmapEx& rBitmap);
              |          ^    ~~~~~~~~~~~~~~~~~
        
/home/michi/development/git/libreoffice/include/vcl/filter/PngImageReader.hxx:59:10:
 note: candidate function not viable: no known conversion from 'Graphic' to 
'ImportOutput &' for 1st argument
           59 |     bool read(ImportOutput& rImportOutput);
              |          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
/home/michi/development/git/libreoffice/include/vcl/filter/PngImageReader.hxx:61:14:
 note: candidate function not viable: requires 0 arguments, but 1 was provided
           61 |     BitmapEx read();
              |              ^
        1 error generated.
    
    Change-Id: I7d322f66a09f76851e9045e8e90684ac35bb48f6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184424
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/avmedia/source/qt6/QtFrameGrabber.cxx 
b/avmedia/source/qt6/QtFrameGrabber.cxx
index b82b02005d9a..44886286e48c 100644
--- a/avmedia/source/qt6/QtFrameGrabber.cxx
+++ b/avmedia/source/qt6/QtFrameGrabber.cxx
@@ -32,10 +32,12 @@ uno::Reference<css::graphic::XGraphic> toXGraphic(const 
QImage& rImage)
 
     SvMemoryStream aStream(aData.data(), aData.size(), StreamMode::READ);
     vcl::PngImageReader aReader(aStream);
-    Graphic aGraphic;
-    aReader.read(aGraphic);
 
-    return aGraphic.GetXGraphic();
+    BitmapEx aBitmapEx;
+    if (aReader.read(aBitmapEx))
+        return Graphic(aBitmapEx).GetXGraphic();
+
+    return nullptr;
 }
 }
 

Reply via email to