Copying referenced images from a folder vs importing singly

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
PaulMaguire
Posts: 44
Joined: Wed Feb 13, 2013 3:38 pm
Contact:

Copying referenced images from a folder vs importing singly

Post by PaulMaguire » Wed Mar 20, 2013 1:42 pm

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.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Copying referenced images from a folder vs importing sin

Post by Dixie » Wed Mar 20, 2013 2:35 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Copying referenced images from a folder vs importing sin

Post by Simon » Wed Mar 20, 2013 8:55 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Copying referenced images from a folder vs importing sin

Post by jacque » Thu Mar 21, 2013 12:13 am

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?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

PaulMaguire
Posts: 44
Joined: Wed Feb 13, 2013 3:38 pm
Contact:

Re: Copying referenced images from a folder vs importing sin

Post by PaulMaguire » Thu Mar 21, 2013 2:13 am

Thanks. Although this doesn't explain why both methods are not identical. Seems counter-intuitive.

Kind regards, Paul.

Post Reply