Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mac Photoshop won't open .png file saved from QImage
Forum Updated to NodeBB v4.3 + New Features

Mac Photoshop won't open .png file saved from QImage

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kloveridge
    wrote on last edited by
    #1

    I'm testing the QImage class and am saving out a simple 256x256 .png file using QImage. The image appears to be okay in the Mac finder. I can see the file, the preview shows what I expect. But photoshop (which is photoshop cc) gives me the message:

    @Could not complete your request because the file-fiormat module cannot parse the file.@

    Wonder if anyone could shed some light on this?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kloveridge
      wrote on last edited by
      #2

      This is the code I'm using:

      @ QFile file(fullpath);
      if( file.exists())
      {
      image = new QImage(fullpath);
      if( image ) {
      QColor fillcolor;
      fillcolor.setRed(0);
      fillcolor.setGreen(255);
      fillcolor.setBlue(255);
      fillcolor.setAlpha(255);
      image->fill(fillcolor);
      image->save(saveP, "PNG");
      stat.note("texture: " + fullpath);
      stat.note2column("Width:", uw::asStr(image->width()),16);
      stat.note2column("Height:", uw::asStr(image->height()),16);
      stat.note2column("Depth:", uw::asStr(image->depth()),16);
      delete image;
      image = NULL;
      }
      @

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Maybe a silly question, but did you check that the image was saved successfully ?

        On a side note, there's no need to allocate it on the heap

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kloveridge
          wrote on last edited by
          #4

          The map did save successfully. I can view it in Mac's viewer. But photoshop refuses to load it.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Do you have any precise error message from photoshop ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kloveridge
              wrote on last edited by
              #6

              Could not complete your request because the file-fiormat module cannot parse the file.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                And it doesn't give you any hint why it can parse it ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kloveridge
                  wrote on last edited by
                  #8

                  No. There is another hint. I have a mac with Parallels. I have photoshop for PC in parallels and photoshop for mac. I cannot load any .png files from the pc partition from the Mac photoshop. But if I use a repository with Git and check in the .png file from the PC side and do a pull on the Mac side, the file will open.

                  Now that's not a .png generated from QImage. That's just a .png file saved from photoshop. So who knows. Its not a big deal. I just thought there might be someone else out there that had seen this.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    What if you try to open your QImage generated png with your Windows Photoshop ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by
                      #10

                      Hi,

                      This sounds like a Mac-Windows filesystem issue, not a Qt issue.

                      I suspect that if you open the PNG in a Windows partition using Windows Photoshop, it will be fine. I also suspect that if you copy the file from your Windows partition into your Mac partition (no need Git), your Mac Photoshop will be able to open it too.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved