Storing a Picture in a Project

I’ve dragged a few pictures to the Navigator left column and have been using them here an there in ImageWells. I had thought that when such pictures are dragged to the Navigator that way, they end up stored in the project. Now I see that only their file references are stored, so if I open that project on a different computer, those pictures are not seen by the project.

Is there a way to actually store them as files in the project?

I save projects in text format. I’m thinking I should just store those picture files in the project folder, assuming there’s no way to store them as files in the project, and update their file references by re-dragging them into their ImageWells.

Never had that problem… I have deployed applications to users around the world, and all graphic resources (icons, pictures etc) were simply “dragged” into the project.

What OS are you talking about? I’ve do this with both OSX and WIN

I’m using OSX. For example, if I drag a picture from my Desktop to the Navigator left column, it appears as little icon in that column with the typical curved arrow that, on OSX, indicates a “shortcut.” If I right click on that object in in Navigator, I see Find On Disk and if I click that it shows me where that file is on my Desktop. If I attempt to open that project on a different computer, Xojo will tell me it can’t find that image file.

No there is no means to simply put them IN the project
Daves talking about the built application which is different than what you asked about

If you’re using text projects place the images in a directory next to your project and make sure when you move to a new computer you bring them along

Thanks, Norman. Does this images folder have to be “next” to my project folder, or can I include it as a subfolder of the project folder?

I imagine storing them “next” to the project folder makes it easier to use them in various projects instead of just one.

you can put it where ever is most convenient for you

here we have it in the same main dir as the IDE project so we check everything into SVN (code, images etc) and that way a new check out also includes all those images

like

    IDE Project
            IDE.rbvcp
            Resources
                    <all our images>
            Folder
                   `
    ... etc ...

At least in my experience the file paths of external items in the Xojo project format are very fragile. It doesn’t matter where your file is as long at the paths are the same on both computers. Xojo doesn’t use relative paths but aliases and absolute paths.

YMMV

[quote=276211:@Beatrix Willius]At least in my experience the file paths of external items in the Xojo project format are very fragile. It doesn’t matter where your file is as long at the paths are the same on both computers. Xojo doesn’t use relative paths but aliases and absolute paths.

YMMV[/quote]

Incorrect
Xojo uses the save info first
IF that does not resolve it will use a relative path
IF that does not resolve it will use an absolute path

x-platform relative paths are the only ones that have a decent chance of working

Ok. I’ll place images in an images subfolder in the project folder. That way my version control system (Mercurial) will see them.

[quote=276206:@Norman Palardy]No there is no means to simply put them IN the project
Daves talking about the built application which is different than what you asked about
[/quote]

I misunderstood… thought you meant the compiled app was looking for the file in the wrong place.

The issue you really meant, I have run across way too many times… especially when I develope on one computer and try to move it to another…

Norman… an idea (and feedback doesn’t work for me …so …)
Would be nice if XOJO would abort a project load (with a messsage) when it hits this error. If you have hundreds of graphics (such as icons)… it takes like 10-30 seconds to determine it can’t find each one… and you then have to dismiss an error dialog for each one… either that or have it count them all up and say “Project aborted because I can’t load 123 external files”

@Norman: this is why I said YMMV. I’ve had huge problems with paths in March to the point where I wasn’t able to open projects. And to be told that what I found wasn’t a bug wasn’t very funny.

Dave’s problems just above sound like mine.

There are ways to make it break
Like using binary projects with a lot of external items & copy the project to a different computer
Why does this make it “break” ?
OS X alias resolution will drive you nuts - which, if I recall, what you experienced
But thats OS X not Xojo doing that
We literally ask the OS to resolve the alias - and thats what you experienced
And if you have a LOT of these then you have a long time getting to the point where OS X stops trying to resolves the aliases and you have to do it for each one
That is one of the downsides to using SaveInfo

I think there is a feature request submitted to make it possible to ignore the saveinfo resolution when opening a project and skip right to relative path / abs path

But its not a “bug”

Based on what I saw in the past:

if all your dragged to the project image files are in one folder, Xojo (and prior) ask you to locate one file, then if he find the others at that location it does not ask you to locate other image files.

So, do not do like me (I put images sorted in several folders), place all your images in a single folder, if you can. :wink: