JPEG Support



  • I know this has been asked a thousand times, but none of the solutions have worked for me. I am creating a very simple web-view gui app. It compiles just fine, but there is no jpeg support when i deploy the app to any other computer other than mine.

    What I have tried:
    compiling QT statically (after 4 days of compiling errors, this is probably not going to work for me)

    Copying the plugin directly into the release version of the App (I would love to do this, but I am not quite getting it right). Here is my .pro contents:

    @
    QT += core gui
    QT += webkit

    TARGET = browser3
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    win32:RC_FILE = MyApplication.rc

    QT_PLUGIN_PATH = plugins
    @

    I then put the qjpeg4.dll file into the plugins folder. This is probably really stupid for obvious reasons which are unknown to me.

    I have been trying to get my simple QT app to work for 5 days. If someone can solve this relatively easy problem, I will forever be in your debt. Although beggars shouldn't demand anything, if you are kind enough to answer with some possible solution, please provide as much detail as possible. I am a noob, so please assume I know nothing. Thanks so much!



  • Try to put in your .pro

    @
    QTPLUGIN += qjpeg
    @

    and in your main.cpp :

    @
    #include <QtPlugin>
    Q_IMPORT_PLUGIN(qjpeg);

    int main(int argc, char *argv[])
    {
    ...
    ...
    }
    @



  • First, thanks for the speedy response! Second, I had tried that earlier, but kept getting errors like cannot find -lqjpegd. However, I figured it out!

    Although I had tried putting the plugin directly into myapp/plugins/imageformats/qjpeg4.dll, and I had tried myapp/qjpeg4.dll, I had not tried myapp/imageformats/qjpeg4.dll. So, although it appears that the plugin path in my project file is completely ignored - I really don't care, as long as it works. Documentation on this, however, would have been invaluable as I lost 4 days of work before stumbling across this solution (by trial and error). Again, plugin worked for me when i did this:

    myapp/imageformats/qjpeg4.dll

    Wow.



  • Hi guys
    I don't know whats going wrong but I've just tried to run a small image browser app on Windows 7 SP1 32bit. This app worked fine for the last couple of month. Now my app can't load jpgeg images anymore. I do have myapp/imageformats/qjpeg4.dll. I've even tried to register the dll, but that gives me an error "The module failed to load". Loading PNG images still works flawlessly......



  • Did you, by any chance, change something in your compilation environment? New Qt version? Using release instead of debug? Changed compiler? All those need to match between the libs, your application and your plugins.



  • I will have to check the consistency of workflow, but I just copied the application folder as is (previously working fine) and again; the same app works fine with PNG images.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.