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. Recent assertions during simultaneous download data from web
Forum Updated to NodeBB v4.3 + New Features

Recent assertions during simultaneous download data from web

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 390 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.
  • P Offline
    P Offline
    pcman11
    wrote on last edited by
    #1

    Hi.
    i develop cross-platform application which gets about 50 files, results are displayed in two slideshows on screen. I use two instances of non-threaded downloader each for one slide, then readed bytearray is stored in array. i made 6 slots for all downloads in parent class, which manages tasks for both downloaders.
    After every finished download, one slot is freed and new download begins, depending of next in queue.
    The main problem is, when i get data - bytearray is created and its reference is send by signal to other class, where it is covnerted to Qimage and goes on, Application crashes sometimes when bytearray is converted to image by QImage::FromData , also tried QPixmap.loadFormData.
    When i qdebug data (left 100 bytes and right 100) - there are valid headers and tails of PNG format, i provided delays after each download - 1000msecs - no difference. It doesnt matter when i download data from network or cache, application crashes during conversion, debugger tells me that reason is "unknown" so - maybe someone bothered with similiar issue? thanks for advice.

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

      Hi,

      Are you properly waiting that the finished signal is called before processing the data you downloaded ?

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

      P 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Are you properly waiting that the finished signal is called before processing the data you downloaded ?

        P Offline
        P Offline
        pcman11
        wrote on last edited by
        #3

        @SGaist Yes, finished signal is connected to proper function, i got data, because its always PNG file, i also check first 8 bytes and last bytes for proper file format, i also check header's pairs for stored file length ant format, also compare retrieved data length with value stored in header, everythinhg looks fine, BOOM apppears during conversion from QByteArray to QImage (QImage::loadFromData)

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then write out the received data into a file and see if it can be read with a painting program.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          P 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            Then write out the received data into a file and see if it can be read with a painting program.

            P Offline
            P Offline
            pcman11
            wrote on last edited by
            #5

            @Christian-Ehrlicher - yes i thought about it - thank You - i think also about reimplement conversion, once I used QImageWriter i don't know yet what's the difference between QImage: conversion and QImagewriter writing to QBuffer maybe its more complex and format-issues-error-proof :)

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              There is no difference between QImage and QImageWriter wrt the image format handling. Just write out the QByteArray into a QFile and take a look with another program.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1

              • Login

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