Image Caching / defaultfolder weirdness
bobsneidar at iotecdigital.com
Fri May 5 16:42:45 CEST 2017
Are your image objects linked to the image files on disk? If so, then include the folder containing your images in your stack files section of the stack properties. That works for me.
Also I am sketchy on how you are building the standalone. If you set up your stack files properly there will be no need to move anything around. The Save As Standalone process will make copies of your images and dynamically link the image objects to the copies.
> On May 5, 2017, at 05:33 , Phil Jimmieson via use-livecode <use-livecode at lists.runrev.com> wrote:
> Hi folks,
> I’ve got an application for Mac and PC which has been developed over a number of years and versions of LiveCode and I’m currently trying to build it with LiveCode 8 on MacOS 10.12.
> A single folder contains both my App and some other folders that contain supporting materials - images etc. In order to use these image resources I use image objects in my app that have relative filenames and in the preopenstack handler of the mainstack I set the defaultfolder to be the folder containing my app and the support folders. I can work on my app in the IDE (where the LiveCode source file is in the folder rather than a compiled app) and all is fine. Images display properly, text files etc. are all in (relative) place. When I compile the App with LiveCode 8 and put that in the folder with the resources, all of my images are broken. I’m guessing that LiveCode is attempting to load them before the defaultfolder is set correctly and just not finding them (I think the initial value for the defaultfolder in a compiled MacOS app is the location of the binary - which is deep inside the app bundle - not the correct place to look for my support folders).
> Has anyone else seen this and have a solution? Aside from making sure the defaultfolder was correct there was no need to do anything else in LiveCode 7 and below. Am I going to have to go through all of my graphics as the application starts up and replace their filenames with valid absolute paths or something?
> LiveCode 9 has exactly the same issue.
More information about the use-livecode