Quantcast

Image Caching / defaultfolder weirdness

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Image Caching / defaultfolder weirdness

Sannyasin Brahmanathaswami via use-livecode
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.

--
Phil Jimmieson  [hidden email]  (UK) 0151 795 4236
Computer Science Dept., Liverpool University, Ashton Building, Ashton Street
Liverpool L69 3BX              http://intranet.csc.liv.ac.uk/~phil/
I used to sit on a special medical board... ...but now I use this ointment.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Image Caching / defaultfolder weirdness

Sannyasin Brahmanathaswami via use-livecode
Can you use the specialfolderpath function to get the correct locations of your resources on various os's?
Bill

William Prothero
http://es.earthednet.org

> On May 5, 2017, at 5:33 AM, Phil Jimmieson via use-livecode <[hidden email]> 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.
>
> --
> Phil Jimmieson  [hidden email]  (UK) 0151 795 4236
> Computer Science Dept., Liverpool University, Ashton Building, Ashton Street
> Liverpool L69 3BX              http://intranet.csc.liv.ac.uk/~phil/
> I used to sit on a special medical board... ...but now I use this ointment.
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Image Caching / defaultfolder weirdness

Sannyasin Brahmanathaswami via use-livecode
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
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.

Bob S


> On May 5, 2017, at 05:33 , Phil Jimmieson via use-livecode <[hidden email]> 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.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Image Caching / defaultfolder weirdness

Sannyasin Brahmanathaswami via use-livecode
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
On 2017-05-05 14:33, Phil Jimmieson via use-livecode 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.

If you are using referenced images (those with filename) then relative
paths will be resolved relative to the folder containing the stack they
are on
first (or should be at least!)

If the stack is the mainstack of the standalone (and thus built into
the exe) then the folder containing the exe (not the app bundle!) is
used.

So - what is the structure of your app on disk?

Does it work on either platform as it stands?

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...