Results 1 to 6 of 6

Thread: Image Saving Problem

  1. #1
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Image Saving Problem

    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
    Last edited by WarGamer; 30th July 2012 at 19:17. Reason: updated contents

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Image Saving Problem

    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.

  3. The following user says thank you to mvuori for this useful post:

    WarGamer (30th July 2012)

  4. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Image Saving Problem

    did you include libs from imageformats directory?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. The following user says thank you to amleto for this useful post:

    WarGamer (30th July 2012)

  6. #4
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Image Saving Problem

    Please clarify what you mean amleto.

  7. #5
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Image Saving Problem

    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
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  8. The following user says thank you to amleto for this useful post:

    WarGamer (30th July 2012)

  9. #6
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Image Saving Problem

    Yes, that is exactly what the problem was. I figured it out just before you told me. But thanks anyways.

Similar Threads

  1. Problem with qwt6 and saving plot as image
    By discovery in forum Qwt
    Replies: 2
    Last Post: 12th November 2011, 19:18
  2. Problem saving JPG image
    By avis_phoenix in forum Newbie
    Replies: 1
    Last Post: 31st July 2009, 15:38
  3. Saving qwt plot as image
    By giusepped in forum Qwt
    Replies: 13
    Last Post: 14th July 2009, 07:39
  4. Regarding saving of image in QTOPIA sdk
    By prajna in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd April 2009, 06:45
  5. Saving already opened image ...
    By Godlike in forum Newbie
    Replies: 14
    Last Post: 28th March 2006, 21:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.