QImage load JPEGs not working - Qt4.6.3, QtCreator2.0, Ubuntu 9.8
I am trying to get JPEG image loading working in QtCreator2.0, Qt4.6.3, Ubuntu 9.8. Basically I am just calling QImage.load() and trying to draw the image using the QPainter. It just doesn’t display any image when the file type is JPEG. When I convert the file to PNG it works fine.
I am getting the snap shot images from a video camera that only creates JPEG format stills.
I tried to install the latest version of libjpeg-dev and I get a message that I already have the latest version:
user1@user1-desktop:~$ sudo apt-get install libjpeg-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting libjpeg62-dev instead of libjpeg-dev
libjpeg62-dev is already the newest version.
The following packages were automatically installed and are no longer required: linux-headers-2.6.31-14 linux-headers-2.6.31-14-generic
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
This is a good question :)
1. How did U install Qt?
2. As far as I understood, any case, qt uses its own plugin to work with jpeg. But building configuration may deny to build plugin, for example, it is key “-no-jpeg”. Perhaps, QT didn’t find jpeg library…
On my pc, qt image plugins are in
libqgif.so libqico.so libqjpeg.so libqmng.so libqsvg.so libqtiff.so
Where is TROLL to explain this situation :)
I’ve also got the same problem.
If it makes any difference I’ve built a number of different versions of qt from 4.5 to 4.6.3 and it has never worked for me. I compile Qt using visual studio 2005 in Windows 7. Although I could download the built libraries from the website I need sqlite support and as such I need to recompile.
Following the previous post I’ve found this errors between a lot more making references to other image plugins.
QFactoryLoader::QFactoryLoader() looking at “C:/Qt/32bitVSSQL/qt/plugins/imageformats/libqjpeg4.a”
“The file ‘C:/Qt/32bitVSSQL/qt/plugins/imageformats/libqjpeg4.a’ is not a valid Qt plugin.” not a plugin
QFactoryLoader::QFactoryLoader() looking at “C:/Qt/32bitVSSQL/qt/plugins/imageformats/qjpeg4.dll”
In C:/Qt/32bitVSSQL/qt/plugins/imageformats/qjpeg4.dll: Plugin uses incompatible Qt library expected build key “Windows msvc debug full-config”, got “Windows mingw release full-config”
“The plugin ‘C:/Qt/32bitVSSQL/qt/plugins/imageformats/qjpeg4.dll’ uses incompatible Qt library. Expected build key “Windows msvc debug full-config”, got “Windows mingw release full-config”“ not a plugin
Does anybody have some idea? That’s something that has been bugging me for a long time.
Well, that’s why I recompiled qt from visual studio. Shouldn’t the standard configuration compile also the image formats plugins?
That depends on you configuration, make sure Qt was configured with JPEG support. Could it be that you tried building with MSVC in the same directory where you already had a MINGW build, and for some reason, JPEG was disabled in your build? That’ll leave stale plugins, which won’t load in your newly built Qt.
I’m getting the same problem on Ubuntu 10.04. QtCreator 4.7.1
Here are details.
Program sources are available, of course.
Works fine on a system where the tools are installed. On a target system without Qt SDK, libqtcore4 and libqtgui4 packages are installed. Plugins are where the program expects them to be, but only the PNG images work, not JPG images. [haven’t checked other formats.]
Build system is x86 and target system is x64 if that matters.
Details contains screen shots of plugin folders, lib paths and supported image formats.
it says JPG is supported, but program will not load JPG images.
Is this a bug between x86 and x64 systems?
Using x86 build and x64 target works fine on Windows system, but plugins are manually moved in that case rather than using package install.
I’m trying to figure out how to package this program for Deb/Ubuntu systems and I have to get it to work first on system without SDK installed.
Do we know what I missed, or is this a bug?
Same problem with SDK 1.1.4 .
I’m trying this code:
but while running I get a “segmentation fault”.
The supported formats are:
- ("BW", "EPS", "EPSF", "EPSI", "EXR", "PCX", "PSD", "RAS", "RGB", "RGBA", "SGI", "TGA", "XCF", "bmp", "bw", "dds", "eps", "epsf", "epsi", "exr", "gif", "ico", "jp2", "jpeg", "jpg", "mng", "pbm", "pcx", "pgm", "pic", "png", "ppm", "psd", "ras", "rgb", "rgba", "sgi", "svg", "svgz", "tga", "xbm", "xcf", "xpm", "xv")
I have libjpeg 8 installed in my system and my application is linked to it:
- ldd my_app
- linux-gate.so.1 => (0xffffe000)
- libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0xb4991000)
- libpng14.so.14 => /usr/lib/libpng14.so.14 (0xb496a000)
- libtiff.so.3 => /usr/lib/libtiff.so.3 (0xb4910000)
- libphonon.so.4 => /home/luca/QtSDK/Desktop/Qt/474/gcc/lib/libphonon.so.4 (0xb2f78000)
- libQtDBus.so.4 => /home/luca/QtSDK/Desktop/Qt/474/gcc/lib/libQtDBus.so.4 (0xb2ef0000)
- libQtXml.so.4 => /home/luca/QtSDK/Desktop/Qt/474/gcc/lib/libQtXml.so.4 (0xb2ea5000)