PDA

View Full Version : Gif/Jpeg plugin



bunjee
31st May 2007, 15:08
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.

high_flyer
31st May 2007, 15:46
maybe you are doing it wrong.
Could we see the code?

bunjee
31st May 2007, 17:06
Sure


mMiniPicture = new QPixmap(zeData/zeR2D2Bmp.bmp);

and the output :

QImage::scaled: Image is a null image.

high_flyer
31st May 2007, 17:35
If indeed ./zeData/zeR2D2Bmp.bmp exists then try:

mMiniPicture = new QPixmap("./zeData/zeR2D2Bmp.bmp");

bunjee
31st May 2007, 18:18
Whoops Sorry wrong line : that one with the bmp works perfectly,

That one doesn't work :

mMiniPicture = new QPixmap(zeData/zeR2D2Jpb.jpg);

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

aamer4yu
3rd June 2007, 07:20
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 :)

sepp
4th June 2007, 09:49
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

Shalabh
4th June 2007, 12:34
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. :)

ksqt
11th February 2008, 14:46
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).

bunjee
13th February 2008, 15:06
I agree on this.