PDA

View Full Version : Image Saving Problem



WarGamer
30th July 2012, 18:49
When I call save on my QImage it fails. There isn't anything wrong with the file name. The image isn't NULL, and is a proper image. The program works perfectly on another computer.

Is there any way to tell why it is failing? I am thinking it has something to do with file permissions, but I don't know where to start. The computer in question is a mac. I was also thinking I could be missing a library, but I copied over everything and mac-dependency isn't giving me any errors.

Update: Trying to save "a.jpg" fails, but "a.png" works. It looks like it has something to do with saving ".jpg" files. I believe Qt doesn't support this natively, but instead relies on the current system to provide the functionality. I probably just need to add a library to the mac.

Any help would be greatly appreciated!

Thanks,

Matthew

mvuori
30th July 2012, 19:11
As you think that it has something to do with file permission, start by testing that you can save any other file to the same folder. Actually, you should test with the very same file name, but use another file writing function.

amleto
30th July 2012, 19:23
did you include libs from imageformats directory?

WarGamer
30th July 2012, 19:50
Please clarify what you mean amleto.

amleto
30th July 2012, 20:16
D:\Code_Libraries\Qt\4.6.0\plugins\imageformats

If you want to run your app on another computer, you may need to include the imageformats directory

WarGamer
30th July 2012, 20:35
Yes, that is exactly what the problem was. I figured it out just before you told me. But thanks anyways.