Hello, Thank you all for the useful comments.
I *think* the LCB feature in LC 10 Steven mentioned is the "is valid" operator, that returns a boolean value indicating whether or not the image data is valid. Also, note that in the upcoming releases of LC 10 we will add syntax for checking if a file/directory exists, so we could check not only image validity but also image existence in the first place. BTW, we have found a workaround for allowing this stack (lazy image example) to work in LC 9 as well. The updated bundle will probably appear in your account area in the next couple of days. Kind regards, Panos -- On Fri, 19 Aug 2022 at 01:13, Alex Tweedly via use-livecode < [email protected]> wrote: > > On 18/08/2022 17:34, Steven Crighton via use-livecode wrote: > > Hi Mike, > > > > I just tested the lazy load example and hit populate and clicked around > etc and could not trigger an error. > > As already confirmed, that problem is fixed in 10. > > However, the lazy load example still contains bugs due to race > conditions, some of which I described in some forum post somewhere (Boy > do I hate the forums! Surely there's some way to check what posts I have > done myself). > > Thinking about it more, there are other race conditions which are > perhaps more obscure, but more serious. I know it's only an example, and > maybe can't be expected to be bulletproof, but as an example of how to > do Lazy Loading it is (IMHO) really too naive and simplistic. People > expect to take those examples and just use them. > > The obvious race conditions are: > > 1. if multiple entries reference the same image, then there is a chance > the earlier ones never get properly updated (sURLToIndex[pURL] will have > been overwritten by the next call to onlineImage before the image value > gets set). > > 2. if the user (or anything else) resets the dataContent of the widget > while there are outstanding "load URL"s, then when the downloadComplete > is triggered, it will set the image value for some random new item to > the image of the earlier one. > > 3. And if the one which was wrongly set in case 2 above also happens to > be a URL that occurs multiple time (i.e. case 1 above), then that > wrongly set image will remain "forever". > > Alex. > _______________________________________________ > use-livecode mailing list > [email protected] > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
