Hi,
thanks for your help!
I've tried QImageReader as suggested but the functions canRead() and read() cannot detect the corrupt jpeg data either.
Looking at the QImage source code, one can see that QImage internally of course relies on QImageReader and thus only fails when QImageReader fails:
{
if (fileName.isEmpty())
return false;
if (!image.isNull()) {
operator=(image);
return true;
}
return false;
}
bool QImage::load(const QString &fileName, const char* format)
{
if (fileName.isEmpty())
return false;
QImage image = QImageReader(fileName, format).read();
if (!image.isNull()) {
operator=(image);
return true;
}
return false;
}
To copy to clipboard, switch view to plain text mode
Any other ideas for detecting images that cause the "Corrupt JPEG data" error message?
Thanks,
mikeee7
Bookmarks