Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Media to byte array
Forum Updated to NodeBB v4.3 + New Features

Media to byte array

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 1.4k Views 2 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.
  • J Offline
    J Offline
    JeTSpice
    wrote on 4 May 2018, 06:47 last edited by
    #1

    I'd like to create an image and sound cache for an application. The image and sound files are retrieved remotely via url. (http://myDomain.com/someCoolImage.png) I want to save the images locally and retrieve them from there, rather than re-download them every session. There are a few suggestions out there about how to convert a byteArray to an image, but not much about converting an Image to any sort of savable format. Anyone know of a good way to do this? Extra appreciation if it can be done in pure qml.

    S 1 Reply Last reply 4 May 2018, 07:01
    0
    • J JeTSpice
      4 May 2018, 06:47

      I'd like to create an image and sound cache for an application. The image and sound files are retrieved remotely via url. (http://myDomain.com/someCoolImage.png) I want to save the images locally and retrieve them from there, rather than re-download them every session. There are a few suggestions out there about how to convert a byteArray to an image, but not much about converting an Image to any sort of savable format. Anyone know of a good way to do this? Extra appreciation if it can be done in pure qml.

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 4 May 2018, 07:01 last edited by
      #2

      @JeTSpice said in Media to byte array:

      not much about converting an Image to any sort of savable format

      Well just save it to the image's format, like PNG or JPEG.

      (Z(:^

      J 1 Reply Last reply 4 May 2018, 23:31
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 4 May 2018, 07:10 last edited by
        #3

        Hi,

        On the non QML side, QCache might be of interest.

        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
        2
        • S sierdzio
          4 May 2018, 07:01

          @JeTSpice said in Media to byte array:

          not much about converting an Image to any sort of savable format

          Well just save it to the image's format, like PNG or JPEG.

          J Offline
          J Offline
          JeTSpice
          wrote on 4 May 2018, 23:31 last edited by
          #4

          @sierdzio But there is no Image.bitmap, Image.byteArray, Image.data, Image.content or similar. No access to the image's data in order to save it.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sierdzio
            Moderators
            wrote on 5 May 2018, 08:54 last edited by
            #5

            Oh, you're talking about QML's Image element? I thought you're downloading the files in C++.

            OK, so here I have 2 hints:

            • use the Image's URL to download the actual file using QNetworkAccessManager in C++ - then saving is easy
            • use an image provider to download / store / retrieve the images in any way you want or need. It will take some time to code it in, but it's potentially a very robust solution

            (Z(:^

            J 1 Reply Last reply 7 May 2018, 18:30
            2
            • S sierdzio
              5 May 2018, 08:54

              Oh, you're talking about QML's Image element? I thought you're downloading the files in C++.

              OK, so here I have 2 hints:

              • use the Image's URL to download the actual file using QNetworkAccessManager in C++ - then saving is easy
              • use an image provider to download / store / retrieve the images in any way you want or need. It will take some time to code it in, but it's potentially a very robust solution
              J Offline
              J Offline
              JeTSpice
              wrote on 7 May 2018, 18:30 last edited by
              #6

              @sierdzio thank you.

              1 Reply Last reply
              0

              5/6

              5 May 2018, 08:54

              • Login

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