twopoint71 / ogg-image-blobber

Simple script to convert jpg image files into base64 blobs suitable for attaching to ogg files.
MIT License
5 stars 0 forks source link

Batch Convert Multiple Files #2

Open the0remora opened 1 year ago

the0remora commented 1 year ago

First of all thanks for creating this script it works really well. I know you haven't touched it in two years but I was hoping you might be able to modify it for me.

I am not good at bash scripting but I have done everything I could think of to try to make the script work on a directory of files. I tried putting it in a do loop, I tried passing it a cat text file of the files, and an ls of all the files but nothing seems to work.

Also as is the script does not work with files that have spaces in the name.

Thank you for your time

twopoint71 commented 1 year ago

Hi the0remora,

Thanks for the interest in the project. Not being able to handle filenames with spaces is certainly a bug which I have fixed in commit 3cb85c9d51a144ae94db89fc3fd3ae690b5606c2.

As for working with multiple files, I do believe in the Linux mantra of do one thing and do it well. That said, I would not script such a task, but rather employ the find tool to do the job

For example, from the same directory in which the images are located, I might run the following to batch convert. find . -type f -name "*.jpg" -exec ./ogg-image-blobber.sh "{}" \;