locked
[UWP][C#] Unexpected and probably improper operation of QueryOptions.SetThumbnailPrefetch RRS feed

  • Question

  • I found that when using this option for query option, loading of thumbnails IS much faster.

    BUT when this option is specified, one can only do

    using ( var thb1 = await sf1.GetThumbnailAsync(ThumbnailMode.PicturesView, THUMB_SIZE, ThumbnailOptions.UseCurrentScale))
    {
    }

    Once on each IStorageItem object in the returned list.

    On the 2nd and subsequent calls, various errors seem to occur, including

    "Value does not fall within the expected range."

    I do expect that GetThumbnailAsync would only use the cached thumbnail once, but I also expect that GetThumbnailAsync would still be successful, and not raise other exceptions.

    A project showing this error can be found here:

    https://onedrive.live.com/redir?resid=D4F79FAF4DF972E5!849660&authkey=!AIpnvC3Mu6U9q-A&ithint=file%2czip

    thx
    -e


    -- me --

    Sunday, November 1, 2015 1:33 AM

Answers

  • The lack of response here is indicative of what is wrong with the forum method of responding to developer requests.  It appears that, after a while, problems that are very critical to development on the system fall by the wayside.

    If problems that make the O/S and development environment less reliable never get fixed, that means that apps that run on the system can never get more reliable (there is only so much we developers can do).

    If me and two other developers can duplicate the problem, it appears to be real.

    I'd like to see some answer that indicates it is being worked for a later version of the UWP SDK. 

    Until then, I (me, not to be confused with MS) recommend developers AVOID using the Prefetch function except in VERY limited cases (Alas, Random Access Data Virtualization cannot be combined with Prefetch).

    -thanks
    -e


    -- me --



    • Edited by Chief Scientist Monday, February 8, 2016 3:26 AM Added disclaimer that this is MY opinion, not MS'
    • Marked as answer by Chief Scientist Monday, February 8, 2016 3:26 AM
    Saturday, January 9, 2016 4:52 PM

All replies

  • same problem in here.
    Monday, November 2, 2015 3:13 PM
  • Wednesday, November 18, 2015 5:43 AM
  • Hello,

    Yes, the example works fine.  But it works because the case is not the same as the one I'm testing.

    To cut a little to the chase, I'm trying to combine Prefetch with a virtualized data model, where as a user scrolls around a list, I have to load and unload thumbnails so that I save memory.

    In that scenario, if one prefetches the thumbnails, and uses the proper pattern that I showed using using ( var thumb = get a thumbnail) to the Bitmapimage, this can only be done once, and then subsequent usages incur exceptions.

    The test case I came up with based upon the FolderEnumeration sample can be found here on GitHub

    The code has been added to scenario 3.

    To see things work correctly, don't check the prefetch button, and press Get Files

    To see the exceptions get thrown (they are caught and reported in this sample), just check the prefetch check prior to pressing Get Files.

    -thanks
    -e


    -- me --

    Sunday, November 22, 2015 8:17 PM
  • Somebody please re-verify that you can reach the sample.

    then, if so, verify you get the same results that I obtained.

    If we can both reproduce, with luck someone will attempt to fix the problem.

    As I said, the workaround is to avoid Thumbnail prefetch, but that slows photo gallery apps that also need virtual data-type operation by quite a bit.

    thanks

    -e


    -- me --

    Monday, November 30, 2015 12:29 AM
  • Any new ideas on this?  Were you able to reproduce using the code I provided?

    -thanks
    -e


    -- me --

    Saturday, December 5, 2015 7:09 PM
  • Yes, I can reproduce.
    Monday, December 7, 2015 5:43 AM
  • So we have reproduction of the problem for me and for @Petwer and @Mankdng (thanks).  Next steps?

    -thanks
    -e


    -- me --


    • Edited by Chief Scientist Wednesday, December 9, 2015 3:38 AM added other repro
    Wednesday, December 9, 2015 3:38 AM
  • The lack of response here is indicative of what is wrong with the forum method of responding to developer requests.  It appears that, after a while, problems that are very critical to development on the system fall by the wayside.

    If problems that make the O/S and development environment less reliable never get fixed, that means that apps that run on the system can never get more reliable (there is only so much we developers can do).

    If me and two other developers can duplicate the problem, it appears to be real.

    I'd like to see some answer that indicates it is being worked for a later version of the UWP SDK. 

    Until then, I (me, not to be confused with MS) recommend developers AVOID using the Prefetch function except in VERY limited cases (Alas, Random Access Data Virtualization cannot be combined with Prefetch).

    -thanks
    -e


    -- me --



    • Edited by Chief Scientist Monday, February 8, 2016 3:26 AM Added disclaimer that this is MY opinion, not MS'
    • Marked as answer by Chief Scientist Monday, February 8, 2016 3:26 AM
    Saturday, January 9, 2016 4:52 PM