Results 1 to 10 of 10

Thread: Gif/Jpeg plugin

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Gif/Jpeg plugin

    Hello,

    I've compiled the open source version of Qt 4.2 supposedly with the JPEG and the GIF plugin :
    configure.exe -qt-gif -qt-libjpeg

    Now I'm trying to use a jpeg or a gif file in my program.
    For some reason it's not loading it.

    Is there something special to do ? or a specific dll to add for this feature to work ?

    Thanks.

    Ben.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Gif/Jpeg plugin

    maybe you are doing it wrong.
    Could we see the code?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Gif/Jpeg plugin

    Sure

    Qt Code:
    1. mMiniPicture = new QPixmap(zeData/zeR2D2Bmp.bmp);
    To copy to clipboard, switch view to plain text mode 

    and the output :

    QImage::scaled: Image is a null image.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Gif/Jpeg plugin

    If indeed ./zeData/zeR2D2Bmp.bmp exists then try:
    Qt Code:
    1. mMiniPicture = new QPixmap("./zeData/zeR2D2Bmp.bmp");
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 31st May 2007 at 16:41.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Gif/Jpeg plugin

    Whoops Sorry wrong line : that one with the bmp works perfectly,

    That one doesn't work :
    Qt Code:
    1. mMiniPicture = new QPixmap(zeData/zeR2D2Jpb.jpg);
    To copy to clipboard, switch view to plain text mode 

    What's the name of the library Qt is using for Jpg & Gif ?

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gif/Jpeg plugin

    You must not have the jpeg support enabled.
    Try compiling Qt with the supports enabled. Search for "jpeg support in qt" in the search if u dont know how to compile the Qt with jpeg support.
    Hope this helps

  7. #7
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Gif/Jpeg plugin

    hi,

    i suppose you use qt4 on win32 (because you mentioned configure.exe)...

    loading of jpeg and gif images is done with plugins in qt4. the plugins are actually dlls on win32, in case of jpeg a dll called 'qjpeg1.dll' (or 'qjpeg1d.dll' for the debug version). they are located in %QTDIR%/plugins/imageformats and are build when you run configure with the -qt-libjpeg parameter followed by nmake.

    if you have the dlls on your system and jpeg loading fails, the application may fail to find the plugins. see QCoreApplication::addLibraryPath(), QCoreApplication::setLibraryPath(), QLibraryInfo and 'Deploying Qt Applications on Qt/Windows' in QAssistant...

    hope that helps

    sepp

  8. #8
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Lightbulb Re: Gif/Jpeg plugin

    Hi,
    Well u can put your 'qjpeg1.dll' (or 'qjpeg1d.dll' for the debug version) in a folder with name "imageformats" then put this folder where currently your executable is present. If you don't do this then on machine where QT is not installed you can't see .jpg. Or after linking lib statically you will not require to provide that qjpeg1.dll inside "imageformats" along with your application.

    Hope it will help you.
    Thanks and Regards,
    Shalabh

  9. The following user says thank you to Shalabh for this useful post:

    bunjee (17th January 2008)

  10. #9
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gif/Jpeg plugin

    Quote Originally Posted by Shalabh View Post
    Hi,
    Well u can put your 'qjpeg1.dll' (or 'qjpeg1d.dll' for the debug version) in a folder with name "imageformats" then put this folder where currently your executable is present. If you don't do this then on machine where QT is not installed you can't see .jpg. Or after linking lib statically you will not require to provide that qjpeg1.dll inside "imageformats" along with your application.

    Hope it will help you.
    I wish the documentation would say this...it would help a lot of newbies (such as me).

  11. #10
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Gif/Jpeg plugin

    I agree on this.

Similar Threads

  1. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  2. Qt Designer plugin on windows
    By big4mil in forum Newbie
    Replies: 4
    Last Post: 30th May 2007, 17:33
  3. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 09:01
  4. Testing a custom Plugin
    By maluta in forum Qt Programming
    Replies: 5
    Last Post: 31st October 2006, 15:09
  5. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50

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.