Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I open openexr image on qt widget
Forum Updated to NodeBB v4.3 + New Features

How can I open openexr image on qt widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
49 Posts 5 Posters 10.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V VRonin
    18 Dec 2018, 08:24

    @Nathan-Miguel said in How can I open openexr image on qt widget:

    but how can I include it in qt

    I imagine you mean Qt Creator. Right click on your project -> add library -> external library -> select the .lib file and the include directory (the d suffix should be detected automatically).

    N Offline
    N Offline
    Nathan Miguel
    wrote on 18 Dec 2018, 19:59 last edited by Nathan Miguel
    #37

    @VRonin even the libs was fine, but in question my qt still does not open and I still have some doubts,

    1. Do I need to add the openexr and libs includes?
    2. Can I continue using the QPixelmap label?
    3. In kimageformat did not come any include in .h, do I have to use .desktop or use the openexr includes to open the image?

    This is the function I'm using to open an image

    void MainWindow::on_actionOpen_Image_triggered()
    {
        QString filter = "Imagens (*.bmp *.cur *.gif *icns *.ico *.jpg *.jpeg *.pdm *.pgm *.png *.ppm *.svg *.tga *.tif *.tiff *.wbmp *.webp *.xmb *.xpm) ;; All Files (*.*)";
        QString filename = QFileDialog::getOpenFileName(this, "Open", QDir::homePath(), filter);
        QFile file(filename);
        QImage image(filename);
        if (!image.isNull())
            {
                 QImage image(filename);
                 image = image.scaledToWidth(ui->labelimg->width(), Qt::SmoothTransformation);
                 image = image.scaledToWidth(ui->labelimg->height(), Qt::SmoothTransformation);
                 ui->labelimg->setPixmap(QPixmap::fromImage(image));
            }
        else
            {
                QMessageBox::warning(this, "Error", "Image can not open");
                filename = "";
            }
    
    }
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Dec 2018, 23:09 last edited by
      #38

      Where did you install the plugins ?
      You can also set the QT_DEBUG_PLUGINS environment variable to 1 in the Run part of the Project panel to see what is happening.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      N 1 Reply Last reply 19 Dec 2018, 12:03
      0
      • S SGaist
        18 Dec 2018, 23:09

        Where did you install the plugins ?
        You can also set the QT_DEBUG_PLUGINS environment variable to 1 in the Run part of the Project panel to see what is happening.

        N Offline
        N Offline
        Nathan Miguel
        wrote on 19 Dec 2018, 12:03 last edited by Nathan Miguel
        #39

        @SGaist The .desktop files are in the files and programs folder, the libs continued in the folder on I compiled, which was in C: / Git / kimageformat / build, and the dll were for the qt compiler itself, msvc2017-64 in the plugin / image folder

        One more thing, in this directory "C: \ Qt \ 5.12.0 \ msvc2017_64 \ plugins \ imageformats", I realized that the "tga" format, had tbm support here, and gives the same error when I try to open open exr in the app debug "QImage :: scaleWidth: Image is a null image".

        First I used the .dll, .pdb files with this name "kimg_exr", then renamed "qexr", both the dll and the pdb, but it still did not work, nor with the native tga that worked right.

        And if it is useful these are my includes

        #include "mainwindow.h"
        #include "ui_mainwindow.h"
        #include <QDesktopServices>
        #include <QMessageBox>
        #include <QUrl>
        #include <QFile>
        #include <QFileDialog>
        #include <QImage>
        #include <QPixmap>
        #include <QImageIOPlugin>
        #include <QImageIOHandler>
        

        source code: https://github.com/nathanmiguel123/Denoiser-Script

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 20 Dec 2018, 22:51 last edited by
          #40

          Did you call nmake install at some point ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          N 1 Reply Last reply 21 Dec 2018, 01:26
          0
          • S SGaist
            20 Dec 2018, 22:51

            Did you call nmake install at some point ?

            N Offline
            N Offline
            Nathan Miguel
            wrote on 21 Dec 2018, 01:26 last edited by
            #41

            @SGaist noup

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 21 Dec 2018, 22:21 last edited by
              #42

              Then this might explain the missing plugins.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              N 1 Reply Last reply 22 Dec 2018, 13:02
              0
              • S SGaist
                21 Dec 2018, 22:21

                Then this might explain the missing plugins.

                N Offline
                N Offline
                Nathan Miguel
                wrote on 22 Dec 2018, 13:02 last edited by
                #43

                @SGaist So I'm practically going to have to build manually?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 22 Dec 2018, 19:56 last edited by
                  #44

                  Build what manually ?

                  The fact that you didn't call nmake install after building the module just means that you didn't install the libraries/plugins you built so that might be a reason why Qt can't find them. You should first try that.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  N 1 Reply Last reply 23 Dec 2018, 19:00
                  0
                  • S SGaist
                    22 Dec 2018, 19:56

                    Build what manually ?

                    The fact that you didn't call nmake install after building the module just means that you didn't install the libraries/plugins you built so that might be a reason why Qt can't find them. You should first try that.

                    N Offline
                    N Offline
                    Nathan Miguel
                    wrote on 23 Dec 2018, 19:00 last edited by
                    #45

                    @SGaist well I did it, but still I keep giving it not opening

                    16:59:10: Running steps for project src...
                    16:59:10: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe" clean
                    	C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug clean
                    	del debug\moc_predefs.h
                    	del debug\moc_mainwindow.cpp
                    	del ui_mainwindow.h
                    	del debug\main.obj debug\mainwindow.obj debug\moc_mainwindow.obj
                    	del debug\src.exp debug\src.vc.pdb debug\src.ilk debug\src.idb
                    	C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release clean
                    	del release\moc_predefs.h
                    	del release\moc_mainwindow.cpp
                    	del ui_mainwindow.h
                    	del release\main.obj release\mainwindow.obj release\moc_mainwindow.obj
                    	del release\src.exp
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\release\moc_predefs.h
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\release\moc_mainwindow.cpp
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\ui_mainwindow.h
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\release\main.obj
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\release\src.exp
                    	del src.exp
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\src.exp
                    	del src.vc.pdb
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\src.vc.pdb
                    	del src.ilk
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\src.ilk
                    	del src.idb
                    NÆo foi poss¡vel encontrar C:\Git\Denoiser-Script\build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\src.idb
                    16:59:11: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited normally.
                    16:59:11: Starting: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake.exe" 
                    
                    Microsoft (R) Program Maintenance Utility Versão 14.16.27025.1
                    Direitos autorais da Microsoft Corporation. Todos os direitos reservados.
                    	"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake.exe" -f Makefile.Debug
                    
                    Microsoft (R) Program Maintenance Utility Versão 14.16.27025.1
                    Direitos autorais da Microsoft Corporation. Todos os direitos reservados.
                    	C:\Qt\5.12.0\msvc2017_64\bin\uic.exe ..\src\mainwindow.ui -o ui_mainwindow.h
                    	cl -BxC:\Qt\5.12.0\msvc2017_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -std:c++17 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\..\Qt\5.12.0\msvc2017_64\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h
                    	C:\Qt\5.12.0\msvc2017_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include C:/Git/Denoiser-Script/build-src-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug/debug/moc_predefs.h -IC:/Qt/5.12.0/msvc2017_64/mkspecs/win32-msvc -IC:/Git/Denoiser-Script/src -IC:/Qt/5.12.0/msvc2017_64/include -IC:/Qt/5.12.0/msvc2017_64/include/QtWidgets -IC:/Qt/5.12.0/msvc2017_64/include/QtGui -IC:/Qt/5.12.0/msvc2017_64/include/QtANGLE -IC:/Qt/5.12.0/msvc2017_64/include/QtCore -I. -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" ..\src\mainwindow.h -o debug\moc_mainwindow.cpp
                    	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -std:c++17 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\src.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\src -I. -I..\..\..\Qt\5.12.0\msvc2017_64\include -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtWidgets -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtGui -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtANGLE -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtCore -Idebug -I. -I\include -I..\..\..\Qt\5.12.0\msvc2017_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\natha\AppData\Local\Temp\nm127F.tmp
                    main.cpp
                    mainwindow.cpp
                    Gerando C¢digo...
                    	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -std:c++17 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\src.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\src -I. -I..\..\..\Qt\5.12.0\msvc2017_64\include -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtWidgets -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtGui -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtANGLE -I..\..\..\Qt\5.12.0\msvc2017_64\include\QtCore -Idebug -I. -I\include -I..\..\..\Qt\5.12.0\msvc2017_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\natha\AppData\Local\Temp\nm1EE4.tmp
                    moc_mainwindow.cpp
                    	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\src.exe @C:\Users\natha\AppData\Local\Temp\nm23F6.tmp
                    16:59:17: The process "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake.exe" exited normally.
                    16:59:17: Configuration unchanged, skipping qmake step.
                    16:59:17: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe" 
                    	C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
                    16:59:17: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited normally.
                    16:59:17: Elapsed time: 00:07.
                    
                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 23 Dec 2018, 22:31 last edited by
                      #46

                      Did you run your application with the QT_DEBUG_PLUGINS environment variable set to 1 to see what exactly is happening with the plugins ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      N 1 Reply Last reply 24 Dec 2018, 14:39
                      0
                      • S SGaist
                        23 Dec 2018, 22:31

                        Did you run your application with the QT_DEBUG_PLUGINS environment variable set to 1 to see what exactly is happening with the plugins ?

                        N Offline
                        N Offline
                        Nathan Miguel
                        wrote on 24 Dec 2018, 14:39 last edited by
                        #47

                        @SGaist I already tried td and q_debug_plugin does not appear, I do not know how to implement it

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 25 Dec 2018, 22:12 last edited by
                          #48

                          Might be a silly remark but the casing is important as well as the name. It's QT_DEBUG_PLUGINS not q_debug_plugin.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          N 1 Reply Last reply 26 Dec 2018, 13:02
                          0
                          • S SGaist
                            25 Dec 2018, 22:12

                            Might be a silly remark but the casing is important as well as the name. It's QT_DEBUG_PLUGINS not q_debug_plugin.

                            N Offline
                            N Offline
                            Nathan Miguel
                            wrote on 26 Dec 2018, 13:02 last edited by
                            #49

                            @SGaist In fact I researched this way, but even so I did not this option, nor to implement in code

                            1 Reply Last reply
                            0

                            46/49

                            23 Dec 2018, 22:31

                            • Login

                            • Login or register to search.
                            46 out of 49
                            • First post
                              46/49
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved