Please see the attached project. It loads two jpg images and tries to save them as png. Image two gets converted to sRGB before saving. Both save calls return false, though the converted one actually does get saved. For the unconverted image a zero size file is created.
This is the debug output:
09:35:21: Starting /home/boud/src/build-qimagetest-5_14-Debug/qimagetest ...
image1 false result true
image2 false result true
libpng error: known incorrect sRGB profile
Result of saving image1 as png false
Result of saving image2 as png false
09:35:22: /home/boud/src/build-qimagetest-5_14-Debug/qimagetest exited with code 0