[Solved]QImage fail to read jpeg--dll deploy problem
-
Chances are you have not deployed the image format plugins (not that you really need them to save the downloaded image as JKSH points out).
-
I release my program with the items as follow
1 : release with the exe compile by mingw4.6.2
2 : put other's dll in the same folder
libgcc_s_dw2-1.dll, libstdc++-6.dll, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtNetwork4.dllTest it on Virtual box and other pc, make sure it has the same behaviour on my pc
-
Yup, that's a better title :) whi
-
I make the codes become easier to read
@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);QImage image("temp.jpg"); qDebug() << image.size(); //the size is (0, 0) even the jpg can be read by other software image.save("haha"); return a.exec();
}
@on my pc, it works prefectly, but other pc just don't work
-
Interesting...
Try this and see if you can get any useful info:
@
qDebug() << "Supported formats:" << QImageReader::supportedImageFormats();QImageReader reader("temp.jpg");
qDebug() << "Can read file?:" << reader.canRead();QImage image = reader.read();
qDebug() << reader.errorString();
@ -
Weird, extremely weird,same dll, same exe, same os
on my pc, the answer are
bq. Supported formats: ("bmp", "gif", "ico", "jpeg", "jpg", "mng", "pbm", "pgm", "pn
g", "ppm", "svg", "svgz", "tga", "tif", "tiff", "xbm", "xpm")
Can read file?: true
"Unknown error"on other pc, the answer are
Supported formats: ("bmp", "pbm", "pgm", "png", "ppm", "xbm", "xpm")
Can read file?: false
"Unsupported image format" -
Try copying C:[Qt-installation]\4.8.2\plugins\qjpeg4.dll
-
I copy the dll of plugins into the folder, but the QImage still don't support jpg
-
http://www.qtcentre.org/threads/32614-DLL-Deploying-problems
Sounds like they succeeded when they put qjpeg4.dll inside a subdirectory called "imageformats"
-
Thanks a lot, the problem solved.