PDA

View Full Version : QT Jpeg, Gif, Bmp loading issue



meraj ansari
21st May 2010, 07:34
Hi all,

I am trying to load image in program and displaying it on label. I am using QPixmap. My code is loading/saving png files but unable to load jpeg,bmp and gif files. I searched the forum and got that i have to use image plugins. so i built my release exe and place imageformat folder with it(e.g. exe is at C:\mydir\test.exe and imageformat folder is placed at C:\mydir\imageformat). I tried to build exe by visual studio 2008 as well as QTCreator but unable to got +ve result.

Any suggestion what i am missing?

wysota
21st May 2010, 07:50
It should be "imageformats".

meraj ansari
21st May 2010, 07:56
@all
my mistake ; imageformat = imageformats
and one more thing i am using LGPL version and Qt's ImageViewer sample is also not loading jpeg images.

aamer4yu
21st May 2010, 08:01
How was your Qt installed ? Did you compile or did you use the binary ?

meraj ansari
21st May 2010, 08:04
I downloaded the sdk from Nokia website and then i installed it. Then i have QT creator to code. After some time i used Visual studio Add in and then follow steps written at - http://dcsoft.wordpress.com/.

wysota
21st May 2010, 08:09
Where did you copy the imageformats directory from? There are two imageformats directories with Qt SDK and you might you used the wrong one. Also, what exactly does this directory contain?

meraj ansari
21st May 2010, 08:30
@wysota

Yes you are right there is more then one imageformats folder. When i searched my Qt dir then i got it.
I was copying from "C:\Qt\2010.02.1\qt\plugins\imageformats" and it is not working. Also it contain dll's and .a files. When i copied imageformats from "C:\Qt\2010.02.1\bin\imageformats" then it is working with jpg,bmp and tiff.

Thanks all

wysota
21st May 2010, 08:33
Actually it should be the other way round. Which probably means you have used Qt DLLs from the wrong directory in the first place.