Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33

Thread: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    It is very hard to say what is wrong with your code without knowing more. I suggest you use a debugger and step through the code to make sure everything is executed correctly. You will probably encounter some oddities which will tell you where to look for errors.

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Quote Originally Posted by dbugger View Post
    const char *buffer = "/root/whitescreen.jpg";
    QPixmap pix;
    pix.load(buffer);
    Does pix.load(buffer) return true? Did you compile Qt with JPEG support?

  3. #23
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Thanks for your inputs

    1. Does pix.load(buffer) return true?
    I checked the return value. It is zero. Does this mean the jpg format is not supported?

    2. Did you compile Qt with JPEG support?
    I did'nt compile Qt with jpg support
    I see the following libraries in the target though- libqjpeg.so and libqjpeg.a
    But any attempts to run the examples like -
    /usr/local/qtopia-core/examples/itemviews/puzzle/./puzzle or any other example throws the following error: "error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory"

    Does this mean that because I have built Qt with static option, I cannot link librraries dynamically.
    Earlier I did try removing the static option but my application was crashing at startup giving some similar error message as the one above. So I rebuilt Qt with static option

    Now, what do you suggest to rectify this. Should I try building QT without static option and with jpeg support or anything on these lines?

  4. #24
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    If you link against static Qt, you can't use regular plugins. Read about static plugins.

  5. #25
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Hi again ,

    To statically link plugins, the doc says to do the following
    - import the plugin
    - make changes to the *.pro file
    Having done this, I faced a compilation error of my application for which I doubted the static option. I rebuilt Qt without static opiton and with jpeg support. But, even now I get the same errors. The error is related to the jpeg library with some undefined references and also some warnings which again indicate towards static and dynamic linking

    Any clues pal??

  6. #26
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Quote Originally Posted by dbugger View Post
    Any clues pal??
    First you have to provide us some clues. Please post the exact error message you get. Most likely you were trying to use dynamic plugins with static Qt.

  7. #27
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Okay, so this is what I did.

    My final setup will be Qt4.3.4 with static option, OS FC5

    Current setup is Qt 4.3.0 without static option and with jpeg support, OS is FC5
    In main.cpp file, I included the following
    #include <QtPlugin>
    Q_IMPORT_PLUGIN(qjpeg)
    And in .pro file ,
    QTPLUGIN += qjpeg

    Now doing a make gives me the following errors (it is long list)
    .
    /home/pjain/thirdparty/qtopia/qtopia-core-commercial-src/../stage/qtopia-core/lib/libQtCore.a(qlibrary_unix.o): In function `QLibraryPrivate::load_sys()':
    qlibrary_unix.cpp:[.text+0x93c]: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /home/pjain/thirdparty/qtopia/qtopia-core-commercial-src/../stage/qtopia-core/lib/libQtCore.a[qfsfileengine_unix.o]: In function `QFSFileEngine::owner(QAbstractFileEngine::FileOwn er) const':
    qfsfileengine_unix.cpp:[.text+0x2de0]: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    qfsfileengine_unix.cpp:[.text+0x2e7c]: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /home/pjain/thirdparty/qtopia/qtopia-core-commercial-src/../stage/qtopia-core/lib/libQtNetwork.a(qhostinfo_unix.o): In function `QHostInfoAgent::fromName(QString const&)':
    qhostinfo_unix.cpp:[.text+0x2c0]: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /home/pjain/ingenient-bsp/../ingenient-app/imedia/net/snmp/bin/libisnmp.a(snmpc.o): In function `isnmp_clientInit':
    /home/pjain/ingenient-app/imedia/net/snmp/src/snmpc.c:221: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /home/pjain/thirdparty/qtopia/qtopia-core-commercial-src/../stage/qtopia-core/plugins/imageformats//libqjpeg.a(qjpeghandler.o): In function `read_jpeg_image(QIODevice*, QImage*, QByteArray const&, QSize, int)':
    qjpeghandler.cpp:[.text+0x156c]: undefined reference to `jpeg_CreateDecompress'
    qjpeghandler.cpp:[.text+0x1580]: undefined reference to `jpeg_std_error'
    qjpeghandler.cpp:[.text+0x15b8]: undefined reference to `jpeg_read_header'
    qjpeghandler.cpp:[.text+0x15c0]: undefined reference to `jpeg_start_decompress'
    qjpeghandler.cpp:[.text+0x1838]: undefined reference to `jpeg_destroy_decompress'
    qjpeghandler.cpp:[.text+0x21c8]: undefined reference to `jpeg_read_scanlines'
    qjpeghandler.cpp:[.text+0x2278]: undefined reference to `jpeg_finish_decompress'
    qjpeghandler.cpp:[.text+0x22f8]: undefined reference to `jpeg_read_scanlines'
    qjpeghandler.cpp:[.text+0x24b8]: undefined reference to `jpeg_resync_to_restart'
    qjpeghandler.cpp:[.text+0x2510]: undefined reference to `jpeg_finish_decompress'
    /home/pjain/thirdparty/qtopia/qtopia-core-commercial-src/../stage/qtopia-core/plugins/imageformats//libqjpeg.a(qjpeghandler.o): In function `write_jpeg_image(QImage const&, QIODevice*, int)':
    qjpeghandler.cpp:[.text+0x2d58]: undefined reference to `jpeg_std_error'
    qjpeghandler.cpp:[.text+0x2d88]: undefined reference to `jpeg_CreateCompress'
    qjpeghandler.cpp:[.text+0x2e3c]: undefined reference to `jpeg_destroy_compress'
    qjpeghandler.cpp:[.text+0x2ee0]: undefined reference to `jpeg_set_defaults'
    qjpeghandler.cpp:[.text+0x3174]: undefined reference to `jpeg_set_quality'
    qjpeghandler.cpp:[.text+0x3180]: undefined reference to `jpeg_start_compress'
    qjpeghandler.cpp:[.text+0x31c8]: undefined reference to `jpeg_write_scanlines'
    qjpeghandler.cpp:[.text+0x3390]: undefined reference to `jpeg_write_scanlines'
    qjpeghandler.cpp:[.text+0x33ac]: undefined reference to `jpeg_finish_compress'
    qjpeghandler.cpp:[.text+0x33b4]: undefined reference to `jpeg_destroy_compress'
    /home/pjain/thirdparty/qtopia/qtopia-core-commercial-src/../stage/qtopia-core/plugins/imageformats//libqjpeg.a(qjpeghandler.o): In function `jpegSmoothScaler::scanLine(int, QImage const*)':
    qjpeghandler.cpp:(.gnu.linkonce.t._ZN16jpegSmoothS caler8scanLineEiPK6QImage+0x28): undefined reference to `jpeg_read_scanlines'
    Now commenting the Q_IMPORT_PLUGIN(qjpeg), solves the compilation problem. But, then the return value for pix.load is still zero

    Now, the errors are the same incase of QT built with static option

    So, I am not sure what is the problem here!!
    Is there any other information that you require?

    Thanks for your support
    Last edited by jpn; 24th March 2008 at 10:41. Reason: added missing [quote] tags and disabled smilies

  8. #28
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    plz ignore the emoticons....got generated!!

  9. #29
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Quote Originally Posted by dbugger View Post
    Current setup is Qt 4.3.0 without static option and with jpeg support, OS is FC5
    You can't use static plugins (i.e. Q_IMPORT_PLUGIN(xxx) and QTPLUGIN += xxx) with non-static Qt.


    Quote Originally Posted by dbugger View Post
    qjpeghandler.cpp:[.text+0x156c]: undefined reference to `jpeg_CreateDecompress'
    This means that linker has problems in finding jpeg library. What commands did you exactly issue?

  10. #30
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Let me clear the confusion

    "You can't use static plugins (i.e. Q_IMPORT_PLUGIN(xxx) and QTPLUGIN += xxx) with non-static Qt."
    Dbugger: Precisely, initially my Qt was with static support. When I imported the plugins, I got meassages that I posted in the earlier reply. This made me doubt that importing of plugins may not always work when Qt is built statically. So, I reconfigured Qt without static support and with jpeg support. When I tested the code, the return value (pix.load) was zero. So I tried importing the plugin, just to check if there is any change, but the error messages were the same. So, I am not sure what needs to be done

    "What commands did you exactly issue?"
    Dbugger: I think you mean here the import plugin commands
    In my main.cpp file, I did the following
    #include <QtPlugin>
    Q_IMPORT_PLUGIN(qjpeg)
    And in .pro file ,
    QTPLUGIN += qjpeg-
    The above two are the only changes that I did

    As mentioned, even building Qt with jpeg support and without static option, still I am not able to succeed

  11. #31
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Quote Originally Posted by dbugger View Post
    "What commands did you exactly issue?"
    Dbugger: I think you mean here the import plugin commands
    I meant the commands you have entered on the console to get that error messages. Where do you run make exactly? What parameters did you pass to configure?

  12. #32
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    "I meant the commands you have entered on the console to get that error messages. Where do you run make exactly? What parameters did you pass to configure?"
    Dbugger: This image code is part of another screen in which I have a button, which when clicked is supposed to show the image that I want to see on the LCD.
    My application is cross compiled.
    So, by doing a make of my application, I get the binary of the entire application on the target

    I hope I am clear!!

  13. #33
    Join Date
    Feb 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Newbie: Require assistance - modify existing jpeg image ,save and display on LCD

    Sorry, I missed the configure options. The following are my configuration options
    ./configure -v \
    -prefix "${STAGE_DIR}" \
    -prefix-install \
    -no-rpath \
    -embedded arm \
    -little-endian \
    -release \
    -no-mouse-pc \
    -no-kbd-tty \
    -no-kbd-usb \
    -no-kbd-sl5000 \
    -no-kbd-yopy \
    -no-kbd-vr41xx \
    -no-kbd-qvfb \
    -no-mouse-bus \
    -no-mouse-linuxtp \
    -no-mouse-yopy \
    -no-mouse-vr41xx \
    -no-mouse-tslib \
    -no-mouse-qvfb \
    -no-accessibility \
    -no-largefile \
    -no-stl \
    -no-nis \
    -no-cups \
    -no-iconv \
    -no-qt3support \
    -no-freetype \
    -qt-libjpeg \ ...
    the above is the current config options. earlier ther was "-static" and no support for jpeg

    Thanks!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.