Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business


OverviewFelgo 2 Support (Qt 5) › How to deal with partially loaded DownloadableResource?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #23779



    I`m using DownloadableResource to store images in cache folder.

    But, as it is an image, and can be used in ListView, and delegate can be destroyed before DownloadableResource is actually loaded.

    As an error, when AppImage loads such an image, I have string in logs:

    Corrupt JPEG data: premature end of data segment

    In this case there is no Image.Error status when image loads file from local fs.

    And there is no (visible for me) method to determine is image was really loaded.

    remove() in Component.onDestruction when DownloadableResource  status is Downloading also does not help.

    Also, DownloadableResource status===Available does not mean file is ready (for me, dont know why), its become available after downloadFinished signal, is it correct?

    1) How can I validate jpeg before loading?


    2) How can I detect and remove partially-downloaded file, if DownloadableResource component is destroyed while downloading?


    Felgo Team


    as a first approach, would it be possible t avoid destroying the DownloadableResource item, because it is effectively not designed to just be destroyed mid-download. E.g. have a download manager class in your app root that takes care of the downloads and is not destroyed at runtime.

    Other than that, you’d probably need to analyze the image yourself. As far as I know, Qt uses libjpeg to decode images. Since the AppImage (using a Qt Image internally, which is derived from QImage) does not display an error, Qt does not seem to report possible decoding errors the image. This is just guessing though.


Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded