Egg-texture-cards command fails if input file/ folder have space in name

Hi All. I am having problem in converting my movie/ gif file to egg in case it has a space in name. I had a file name “some spacy name.gif”:

  1. I used ffmpeg to convert it frame wise in folder “some spacy name”
  2. run the command “egg-texture-cards -o “some spacy name.egg” -fps 24 …/media/some spacy name/*.png”

Now this throws error that png image was not found. I tried many options like single quote, double quote, around folder name, around full path etc., but no use!
BTW, the egg file name is not issue, as in i can give space in its name and that works as long as folder name do not have any space.

Any idea on how to overcome this issue. As this code is in C++, i cannot help myself with that! Thanks in advance.

Have you tried putting a backslash before each space?

YEs, tried that too, of no use (atleast on windows).
the only option was to put ? instead of space, though it is a very bad option for me as my users (who are supposed to be non technical) can have some file like “good person” and “goodyperson”, which might breakup a bit with ?, which is just a wildcard.
No good clue till now!

Based on a quick test, what happens if you put inverted commas around only the section of the path that has spaces?

That is, if instead of running this:
egg-texture-cards -o "Some Path Name/mew.egg" -fps 24 "Some Path Name/*.png"
you run this?
egg-texture-cards -o "Some Path Name"/mew.egg -fps 24 "Some Path Name"/*.png
Note the positioning of the inverted commas in the latter example.

In a quick test under Ubuntu, a command like the former failed, while a command like the latter succeeded.

Thanks a lot for quick response, sadly this do not work in windows atleast!

C:\ProgramData\Memeer\demo\media>egg-texture-cards -o loadbird.egg -fps 24 “load bird”\*.png

Unable to read image load bird/*.png
Some textures not found; not generating egg file.

while the files are present:

C:\ProgramData\Memeer\demo\media>dir “load bird”
Volume in drive C has no label.
Volume Serial Number is E0C2-4027

Directory of C:\ProgramData\Memeer\demo\media\load bird

2021-06-01 12:58 PM .
2021-06-01 12:58 PM …
2021-06-01 12:52 PM 248,557 rush__0001.png
2021-06-01 12:52 PM 248,492 rush__0002.png
2021-06-01 12:52 PM 248,460 rush__0003.png
2021-06-01 12:52 PM 248,598 rush__0004.png

This command in my case will be executed from os.system python API, so i was thinking of renaming directory to some temp name (random or just some timestamp), create egg file there, update egg content with correct file path, and rename back (i will be anyway copying around lots of images from panda and ffmpeg, so maybe users might not notice much performance issue).
But still i fail to see any reason this should not work? for all i could understand Cpp, same setup is read to get directory for all the files, and they all are happily working except this one :frowning:

EDIT: One thing worth mentioning here is that (along with your command on linux) the below command work:
egg-texture-cards -o loadbird.egg -fps 24 “…\media\bird 25.png”

which makes me think this might have something to do with forward/backward slash with *.png!

Ah, it’s a pity that it doesn’t work! And indeed, I don’t know why it doesn’t. :/

All that I can say is that it looks like the file-path isn’t being properly expanded. Generally speaking, and if I have it correctly, when a command-line tool is given a file-path with an asterisk like that, the system expands the result into a list of individual files, and then passes that into the command.

It looks like Windows is perhaps not doing that when the file-path includes inverted commas for some reason…

Hmm… I’m not sure that it’s a good idea to rename a user’s directories, even temporarily. :/

It’s tempting to suggest the inverse–copying the files to a directory that you create and then deleting the directory afterwards–but moving what may be a lot of files might be rather slow, I fear.

Sorry, just edited my post and found you have already replied :slight_smile:
But yes, somehow windows does not expand how it should!

Temporary directory executions should not be an issue here (i believe) as my tool is expected to work like:

  1. In the installation directory, user creates a new project (like demo in my case)
  2. S/He puts all movies and images to be used for animation in {project}/media directory
  3. When refreshed, the movies will create their frame wise images (or they can be copied from previous animation frames) and then the egg file will be generated which they can use in their next animation “act”

The only other (valid) option is something like below though it might get bit huge and i do not know if there is some command line length limit and am not at all interested to let my users found that out for me :slight_smile: .
egg-texture-cards -o loadbird.egg -fps 24 “load bird”\rush__0987.png “load bird”\rush__0988.png “load bird”\rush__0989.png …

1 Like

Hmm… I don’t know! On both the matters of user-directory manipulation or Windows command-line limits, I’m afraid!

I’ll defer to others on this for now, I think.

Thanks anyway for looking into it :slight_smile:
For anyone interested, here is what work and do not:

C:\ProgramData\Memeer\demo\media>egg-texture-cards -o loadbird.egg -fps 24 “load bird”\rush__0001.png

Writing loadbird.egg

C:\ProgramData\Memeer\demo\media>egg-texture-cards -o loadbird.egg -fps 24 “load bird”\rush__???.png

Unable to read image load bird/rush__???.png
Some textures not found; not generating egg file.

I checked for wildcard in windows, and maybe you are rifght. I am not a Cpp person, but here is what MS guys have to say on such topic: Expanding wildcard arguments | Microsoft Learn “By default, wildcards aren’t expanded in command-line arguments.”

2 Likes