In my desktop app (for Mac and Windows), I need to be able to load images (for display.newImage) from anywhere in the user’s file system. I am using the tiny file dialogs plug-in and other ways to allow the user to locate the image they want, which gives me a full pathname for the image file. The problem is, display.newImage only allows relative pathnames, (relative to system.DocumentsDirectory being the only logical choice here).
So, right now I have to do a nasty and platform-dependent partial workaround to compute a path relative to system.DocumentsDirectory (which by the way is not the normal Documents folder but the hidden app support folder…). To try to make it general, right now I’m running up to the root then back down to the desired file, like:
…/…/…/…/…/…/…/…/path/down/from/root/to/finally/file.png
but this won’t work across different drives or networks, is a mess to test, is platform-dependent, etc.
Does anybody know a better way? Or any chance I can convince Corona to add a baseDir option for images (and sounds) for use on desktop only that essentially disables the baseDir and treats the filename like a normal full or relative path (just like io.open would)?