Interesting problem. This might be a wild goose chase but ....
From QPixMap.cpp:
bool QPixmap::save(const QString &fileName,
const char *format,
int quality
) const {
if (isNull())
return false; // nothing to save
return doImageIO(&writer, quality);
}
{
if (quality > 100 || quality < -1)
qWarning("QPixmap::save: quality out of range [-1,100]");
if (quality >= 0)
writer->setQuality(qMin(quality,100));
return writer->write(toImage());
}
bool QPixmap::save(const QString &fileName, const char *format, int quality) const
{
if (isNull())
return false; // nothing to save
QImageWriter writer(fileName, format);
return doImageIO(&writer, quality);
}
bool QPixmap::doImageIO(QImageWriter *writer, int quality) const
{
if (quality > 100 || quality < -1)
qWarning("QPixmap::save: quality out of range [-1,100]");
if (quality >= 0)
writer->setQuality(qMin(quality,100));
return writer->write(toImage());
}
To copy to clipboard, switch view to plain text mode
And from the QImageWriter docs:
If any error occurs when writing the image, write() will return false. You can then call error() to find the type of error that occurred, or errorString() to get a human readable description of what went wrong.
So maybe the following would give you a clue:
writer.write(toImage());
qDebug()<< writer.errorString();
QImageWriter writer(fileName, "JPG");
writer.write(toImage());
qDebug()<< writer.errorString();
To copy to clipboard, switch view to plain text mode
Bookmarks