I am trying to save images in Qt. I am able to save all the formats except jpeg. I have the following libraries under the plugins/imageformats folder.
libqgif.so, libqjpeg.so.
Do I have to place them in a different folder to make this work? Is there any new libraries that I have to install to make this work. I work on linux platform and my application is supported on all linux platforms. So do I have to install separate libraries for each platform?
Thanks,
You might find what the problem is by:
Setting the environment variable
QT_DEBUG_PLUGINS
to 1 before running your application.It will print the plugin loading attempts/successes/failures on the console.
Using a
QImageWriter
to get a more explicit error message than with justQImage::save
orQPixmap::save
:Try adding the following line to your main:
Check if the linking in the .so files are proper.
Under windows the
qjpeg4.dll
must in aimageformats
directory under the application's directory by default.