Caching Images (SOLVED)

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Caching Images (SOLVED)

Post by Traxgeek » Mon Sep 01, 2014 3:29 pm

Hi,
I have sooooo many questions but I'll confine this topic to Images and the caching of them...

Pre-LC6 any mods I made to an (external) image would be 'available' to other pages in LC as soon as I 'refreshed' an image control with the appropriate filename...

In LC6 (after some head bashing) it would appear this is no longer the case ! grrrrr... I tried to see what happens in LC7 but that just crashes on load and corrupts my file !!! Works perfectly in version 5.5.x though.... but I deleted that an age ago once I thought I was OK to do so...

It would appear that (for good or bad) LC now caches images. This 'makes sense' if one wants to use the same image in various locations BUT...
in my case (I've always predisposition for the dark side...) I have thumbnails of various images each in a specific line of a DataGrid (on card 'A'). Clicking on the DG entry (on Card 'A'), shifts to the next card (Card 'B') where the image is shown in all its magnificence (which works wonderfully). On this card one can now adjust / amend the image and re-save it (with the same filename). Upon completion of the save routine, the user is returned to Card 'A' where the DG displaying the image thumbnails is re-created from scratch and re-displayed... BUT, alas, without the modifications...

Navigating around my app changes nothing - the original image(s) are displayed and do not reflect their amendments...

Opening Finder (I'm on a Mac) and navigating to the 'user file' area one can see the amended image has in fact overwritten the original image; LC just refuses to update it !

Exiting my app (and LC) and then restarting, 'fixes' the issue and displays the updated image (as expected). A little inconvenient. . .

I fully understand that there are reasons for this but... How to flush / clear / delete the cache or at least the original image within it ? ? ?

I can't find any refs as to deleting / clearing the cache... The only thing I can think of is to delete all references to the image controls that display the original image, then reloading them / the one I need ! Seems a little excessive / cumbersome but... needs must...
The problem I'm experiencing here though is that using 'set the dgData of Group "MyDG" of card "CardA" to empty' and clearing the edit image itself (in fact all controls that contain the image - and a load that don't besides) doesn't seem to help...

Any thoughts please ? These sort of things are soooooo frustrating and slowly driving me crazy !
Eternally grateful.
Last edited by Traxgeek on Fri Sep 12, 2014 4:25 pm, edited 1 time in total.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Caching Images

Post by Traxgeek » Tue Sep 02, 2014 4:13 pm

Bump -

Upon a lot of trial and error, this seems to be a 'problem' limited to me alone !

I understand that 'in theory, one can 'flush' the cache by deleting ALL references to the used image...
BUT - how to do THAT in a datagrid ? ? ?
I have tried the 'set the dgData of group "MyDataGrid" to empty' - which doesn't work !! :(
If I delete the datagrid (gulp - this naturally includes all the Row Behaviour scripts etc...) then my problem goes away ! But, I loose my DG ! :evil: (obviously).

So, back to my question :

Is there a way to reset the pointers / filenames of images within a DG ? Seems excessive and long-winded but... I guess I could cycle through my DGs (somehow) resetting the filenames of image controls to 'empty'...

Thoughts, better ideas ? All welcome !

Thanks a million
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Caching Images

Post by Traxgeek » Fri Sep 12, 2014 4:24 pm

LC Version 6.6.2 seems to fix this issue!
It's still necessary to remove all existences of an image if one wants to see it refreshed (incl. setting the DGData to empty) but it now works !
Fantastic stuff !
I stumbled upon this after 'upgrading' 6.5.0 to 6.6.2
All done.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Post Reply