Locate picture ... asks for every picture, in the same directory

I’ve just finished updating over a hundred images for an older app in order to support Retina / HiDPI. I did all the work on Mac and now I’m moving it to my Windows 10 laptop for the Windows build. I fully expected Xojo to open with the window telling me the images resources couldn’t be found, and then prompt me to locate the image files. So far so good …

What I did not expect is that the IDE is asking me to locate every single image file (!) They are all in the same place. Once I locate one of the images, Xojo should find the rest, but it doesn’t. Like I said, for over 100 images, I’m being asked to go click on every single file in the same directory. This is absurd …

I would report this to feedback but as I reported recently, Feedback kicks me off.

This behaviour has existed since forever… even worse if you move a project from one machine to another.

I don’t know if the new imageSets makes this cleaner or not

Sure seems like it should be a no-brainer for the Xojo team to fix this. Save a successful path and look there for the next file. Really, how hard is that ???

That’s exactly what I’m doing here.

No, it makes things worse, because you have to go click on 3 images for each set. At least it asks for each set in order: x1, x2, x3, but it doesn’t ask for the files in order, so you have to go searching through the folder every single time.

using what version ?
I swear I did some work to make this retain old successful paths and use those before asking again

edit : what kind of project ? text ?

[quote=451509:@Norman Palardy]using what version ?
I swear I did some work to make this retain old successful paths and use those before asking again

edit : what kind of project ? text ?[/quote]

Xojo2019r1, normal project (the same one I’ve been working on that requires all the DLLs / dylibs) …

The IDE does resolve all the paths correctly for a project moved between computers having the same OS, and yes I remember when that was fixed years ago.

It’s moving from Mac to Windows or vice versa that is failing. Here I have moved the project from Mac to Windows, and on Windows, every single image file pops up with the stored Mac file path and asks me to find the file on Windows, even though all the files are in the same directory. Clearly, it should not be doing this.

For what it’s worth, in a Desktop project where I’m doing most of the work on Mac, I’ve got about 200 *.png files that have been dragged-and-dropped into Image sets.

After testing my app with the new icons and images, and before committing to source-control and testing on Windows, I run the “Collect Project Items…” feature under the “File” menu. This appears to collect local copies of all my images from folders external to my project and place them in a “Images” folder at the root of my Xojo project. So when I run the app on Windows, there is no prompt to locate the missing new images.

In my case, the *.xojo_image file shows a Mac style absolute path in the “FullPath” property, the “PartialPath” property shows a relative Windows style path.

2019r1.1

I hope that helps.

Worst, there is no check against the “new” correct path: you can choose a different image than the one you are asked…

And I do not recall seeing the name of the requested image.

Too late for Aaron, but, place all images in a single root image folder (with sub folders for clarity) and import the from there before switching the project. In the other platform, do not try to update the images locations. Simply delete the references from the Navigatin pane, then import that folder into the project.

NOT TESTED: check with a simple (with only some images, not hundreds) set of images before attempting to do the same with larger ones. *

  • I do not recall if I had troubles doing that (years ago).
    (I may have a wrong memory: missing subclasses instead of broken disk links… ? I am unsure)

I hope this helps.

(https://xojo.com/issue/56493)>]<https://xojo.com/issue/56493>

That’s not true … this has been working already with some old REALbasic or Real Studio versions ;-).

I usually make sure to store any resources in the same folder as the Xojo Project file (or of course a sub folder in there) first. Only then drag the items into the Xojo Project.
That results in the paths stored “relative to the project file”. And with that, I never ever had issues moving between different machines or Mac/Win.
But yes - this “select one, and it’s folder is being checked for other items, too” used to work in the REAL Studio days… if it doesn’t any longer, I’d file a Feedback for that.

Thank you, Scott. I’ll remember to do that next time. I had forgotten about this. I had used that feature a few years ago when I got a new MacBook and all the image paths in all my Xojo projects had to be updated, and until now I had no reason to use it again so I had forgotten about it. That is the trick to use here!

Thank you, Emile. This could be good advice for some projects where all resources are assigned in code. It’s not a good option when images have been assigned to toolbar icons or background properties of controls in the project viewer, because all those images then have to be reassigned by hand after skipping the import step, which can be even worse than having to click on the files.

For projects on the same OS, yes. Not for projects moving between platforms. It seems like a Feedback should be filed, but since there is a workaround (collect project items) and since I am unable to file reports without Feedback kicking me off before the report gets filed., I’m leaving it at that.

Thanks everyone.

Sorry. I suspected that, but my memoryBlock is corrupted !

Arbed can also consolidate a project.

Well, I just tried this with a different project I’m updating today, and it did not work. I collected the project items on the Mac, then copied the project to Windows, opened it up, and I was still asked to find every image file. So this issue is not solved.

Aaron - How are you copying the project from the Mac to the Windows system? I’ve found that compressing the project folder and copying the Zip file is the best if you are not using a version control system like CVS, SVN, or GIT. And never try to work on a project shared over SAMBA/CIFS from a Mac to Windows. Check your permissions on the Windows system for the copied files.

Hi Aaron,

If your Xojo project is a source-code friendly “text” type, do you have *.xojo_image files in your problem project? If so, try opening one of the files with a text editor (choose a file that represents a problem image). For example, you should see something like the following:

#tag MultiImage Image txItalic #tag ImageRepresentation SaveInfo = APHRcwECAQAAAAFiAAAAAAFiAAIAAAxNYW<truncated for readability> FullPath = /Users/scott/Project/Blurg/Code/Images/txItalic.png PartialPath = Images\\txItalic.png #tag ImageSpecification Comment = Device = 31 HSize = 28.00 Orientation = Any Platform = 15 PPI = 72 VSize = 28.00 #tag EndImageSpecification #tag EndImageRepresentation #tag ImageRepresentation SaveInfo = APHRcwECAQAAAAFqAAAAAAFqAAIAAAxNYWN<truncated for readability> FullPath = /Users/scott/Project/Blurg/Code/Images/txItalic@2.png PartialPath = Images\\txItalic@2.png #tag ImageSpecification Comment = Device = 31 HSize = 28.00 Orientation = Any Platform = 15 PPI = 144 VSize = 28.00 #tag EndImageSpecification #tag EndImageRepresentation
Notice the FullPath and PartialPath values, where one is a Mac style path and the other a relative Windows style path.

What do your problem paths say?

I noticed, by watching the changes in GitHub Desktop, that these paths change from addresses external to my project to the above - after running “Collect Project Items…”.

And the funny thing about using “Collect Project Images…” that I found, is that even though all your source images maybe in different directories before hand, after they are “collected”, they are all dumped into a single “Images” folder inside the root of your Xojo project (and the images are not renamed).

Which means that if any images happened to share the name of another image, it won’t copy over because it appears the collection process does not want to overwrite an existing file. Some warning messages should appear at the end of collection process, if there is a name conflict. Note: these warning do not prevent the project from running, but it also means your images weren’t collected inside the project.

In other words, all your image filenames need to be unique before running the “Collect Project Images…”.

I hope some of this helps, but I know the above is based purely on my own experience and I’m still a relative novice in Xojo.

Good luck!

Back to basics:

  1. What is the weight of the total (100s) images ? (1MB, 10MB, 100MB ?)
  2. Did you clears the Xojo Cache ?
  3. What kind of project kind are you using ? (SVN stype, Binary, XML ?)
  4. Have you tried to export the project into another file kind ?
  5. As said earlier (differently, but…): did you checked the images file names ?
    (Conflicts / non ASCII names / file extension, etc.)
  6. Check your hard disk (with DIsk Utilities)…

Have you tried to make a simple project test like:
Create a new folder and put inside:
A brand new project (same characteristics as the offending one)
No code,
Import all images into that folder (in its own folder: same images as found in the offending project),
Save.

Move the whole in Windows,
Load the project under Windows and …

Copy the offending project to a different (local) hard disk (either in a SSD or HD)

Sometimes Murphy’s Law is striking: one think “this” cannot happens and hours / days… later, the horrid truth reveals itself: “this” happened !

I’d like to know how to do that. The only kind of Xojo project file I can save is .xojo_binary_project

The nyou cant
You need at least a pro license to save as a xojo text project

Hi Aaron,

If this is your only Project save format option, it sounds like you may have a Xojo “Lite” or Desktop only license.

I think to have Xojo save your projects in the source-code friendly “text” type (where most of the Xojo project is broken out into various text-based files), you will need a “Pro” license. I have a Pro license, but I am not really familiar with what does or does not come with the various license levels.

Please email hello@xojo.com for more information on what your license allows, or for potentially upgrading.

I hope that helps. Good luck!

You need Desktop license or higher