Page 1 of 1

Using local URLs

Posted: Mon Aug 15, 2011 8:39 pm
by Pebah
I'm trying to create URLs to picture files on the local hard drive. A Image folder exists inside the same folder as the stack. I'm finding the RunRev user guide to be inscrutable about designating the path to the file. Using "./Images/filename.png" doesn't work. Putting file into the same folder and using just "filename.png" doesn't work either. I tried the "binary:" thing also without success. I tried copying the URL in the Inspector for that image when it is displayed without luck either. Why is this so hard? Would it be too much to ask for a file browser palette that allows drag and drop creation of URLs?

Re: Using local URLs

Posted: Mon Aug 15, 2011 8:51 pm
by bangkok
This stack should help you.

-how to select a JPEG or GIF file from hard disk

-how to display it into an image object

-and therefore, how to deal with path

Re: Using local URLs

Posted: Mon Aug 15, 2011 11:14 pm
by Pebah
bangkok wrote:This stack should help you.

-how to select a JPEG or GIF file from hard disk

-how to display it into an image object

-and therefore, how to deal with path
Well, I had to disable part of the line that filtered the file type since it then greyed out all the possible images files in the file dialog:
answer file "Select a file " -- with filter "Web Graphics,*.jpg;*.gif;*.png"

Then it didn't show the relative file URL but the absolute URL (/Users/Peter/Projects/....icon.jpg). I'll keep working on this...

Re: Using local URLs

Posted: Tue Aug 16, 2011 2:30 am
by doc
Not for sure this is what you are looking for based on your description...
I've attached a zip file containing a stack that should properly display an image who's location in a sub folder is always relative to the location of the stack file or executable.

HTH,
-Doc-

Re: Using local URLs

Posted: Tue Aug 16, 2011 5:08 am
by BvG
for relative paths, you need to make sure the defaultfolder is set to what you want. this can be tricky, as it is different on mac os standalones (because bundles are folders). theres some additional paths that the engine automatically checks for stacks, but i think that does not apply to images. maybe the filename of the stack plays into it?

Re: Using local URLs

Posted: Wed Aug 17, 2011 6:18 pm
by Pebah
doc wrote:Not for sure this is what you are looking for based on your description...
I've attached a zip file containing a stack that should properly display an image who's location in a sub folder is always relative to the location of the stack file or executable.

HTH,
-Doc-
That works!

"Effective filename" is the secret. Thanks!!!