0

I was trying to build a project using QDir and QImage. I noticed that in Debug configuration everything works fine - QDir loads all the files in an app dir and writes whole paths to output. I can load an image to a QImage object, convert it and save.

Changing config to Release output's a totally different behaviour. I see QDir still able to read and write to the console screen good paths, but the loaded image is always NULL so it's not loaded at all. I've tried also to make it via .load(filename), .load(filepath) but it's not working. Format of my images is JPG.

Why is it happening?

makciook
  • 1,537
  • 10
  • 19

1 Answers1

0

If you are using relative paths while loading an image file. There is a chance that release and debug build paths might be different, either you intentionally or accidentally changed it.This happens if you are using qtcreator ide to build. I don't see any other reason.Try using absolute path or make the build directory the same for both.

ScarCode
  • 3,074
  • 3
  • 19
  • 32