Qt- unable to save jpeg files

前端 未结 4 2094
遥遥无期
遥遥无期 2021-01-06 05:28

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,

4条回答
  •  感情败类
    2021-01-06 06:17

    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();
      }
      

提交回复
热议问题