Page 1 of 1

Copying referenced images from a folder vs importing singly

Posted: Wed Mar 20, 2013 1:42 pm
by PaulMaguire
Hi.

I'm STILL struggling to get into the Livecode workflow for iOS.

When I import a referenced image singly, its filename is relative to the stack e.g:
"./Media/WebImages/thisImage.jpg"
Great.
However, when I import a referenced folder full of images (New Referenced Control/All images in folder...) its filename is absolute e.g:
"/Users/Paul/Documents/CurrentJobs/Development/Media/WebImages/thisImage.jpg"
Not great.

It means it looks fine in authoring (images appear), and in the simulator (images appear) but not when testing on hardware (no images - grey box instead). What gives? Why should this be any different? If I import them singly they work as expected, but I cannot waste my time doing this - there are lots of images! BTW I have the entire Media folder included in the Copy Files tab of the Standalone Application Settings. I feel like an idiot asking such simple questions here! Apologies.

Kind regards, Paul.

Re: Copying referenced images from a folder vs importing sin

Posted: Wed Mar 20, 2013 2:35 pm
by Dixie
Paul...

importing the folder full of images into your app through the 'copy files' pane will place them in the 'engine' folder... so the path on the device would be:

Code: Select all

specialFolderPath("engine")/CurrentJobs/Development/Media/WebImages/thisImage.jpg
Dixie

Re: Copying referenced images from a folder vs importing sin

Posted: Wed Mar 20, 2013 8:55 pm
by Simon
Hi Paul,
With Dixie's post I guess you should set up a custom (or global) property:

Code: Select all

on preOpenCard
if the environment is "development" then put "/Users/Paul/Documents/CurrentJobs/Development/Media/WebImages/" into imagePath
else
put "specialFolderPath("engine")/CurrentJobs/Development/Media/WebImages/" into imagePath
end if
end preOpenCard
hmmm actually, I wonder what the path is in the simulator but you get what I mean.

Simon

Re: Copying referenced images from a folder vs importing sin

Posted: Thu Mar 21, 2013 12:13 am
by jacque
In the general pane of preferences, there's a setting named "always use absolute paths for images". If it's on, does it help if you turn it off?

Re: Copying referenced images from a folder vs importing sin

Posted: Thu Mar 21, 2013 2:13 am
by PaulMaguire
Thanks. Although this doesn't explain why both methods are not identical. Seems counter-intuitive.

Kind regards, Paul.