0

This piece of code works correctly on my development computer, but not on a test one:

QImage img("Y:/SharedImages/img.jpg");
cout << "TEST image size: " << img.size().width() << " x " << img.size().height() 
     << " Null? " << img.isNull() << endl;

The image is on a shared drive, so it is exactly the same one.
The image path is the same on both computers. I can open it with other tools with that path on the test PC.
On the test computer I get an invalid image (isNull() = true), while on the development one it is a proper image.

I cannot find the reason of this behaviour...

Platform:
- Windows 7
- MinGW/GCC 4.6.2
- Qt 4.8.4
- QtCreator 2.7.0

Pietro
  • 12,086
  • 26
  • 100
  • 193
  • 4
    You need to provide the image plugins to your application. Copy the plugins\imageformats directory into your application directory. Also, check if your second computer can access to the file with QFile::exists(). – Dimitry Ernot Jun 05 '13 at 11:43
  • @RomhaKorev: "access to the file with QFile::exists()" - You mean QFile include file? – Pietro Jun 05 '13 at 13:58
  • @Roku: Yes, you are right. Following those indications I fixed my problem. You can delete this question. Thank you. – Pietro Jun 05 '13 at 14:49

0 Answers0