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 just QImage::save
or QPixmap::save
:
QImageWriter writer("/tmp/test.jpg");
if(!writer.write(pixmap.toImage()))
{
qDebug() << writer.errorString();
}
Under windows the qjpeg4.dll
must in a imageformats
directory under the application's directory by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With