Space in JPG Output File: Cannot Specify Compression Level

I am applying LUTs to JPG using gmic and all works fine except when my output filename contains one or more spaces: In that case I cannot add, .e.g, ,30 after the filename to specify the compression level. If I do that I am getting / Output image [0] as jpg,30 file ‘./_lut-converted/_MG_1649__Ilford Delta 3200 4 ++.jpg,30’ (1 image 3686x5529x1x3).
I tried to add backslashes in front of the spaces but that does not change the result. Any ideas. By the way, I am running this on a Mac.

Moin @Helmut_Kaufmann, and welcome!

I am not a McPerson,
but what if you try to add
_30 (i.e. an underscore instead of a comma)?
I have a feeling that the comma might be troublesome…

Have fun!
Claes in Lund, Schweden

Hello Claes. Thanks, I tried and it does not change the result. Also, when I use commas with other functions, the comma works. What is interesting: With input files, spaces are not an issue… Cheers, Helmut


you could try something like this ? It worked on my Linux box.

gmic sp -o \“./Downloads/_MG_1649__Ilford Delta 3200 4 ++.jpg\”,30

1 Like

Welcome @Helmut_Kaufmann ,

I think this is the way to do it, with bash:

o \"filename with spaces.jpg\",30

If you don’t backslash the double quotes, then it will save a file, where the ,30 is included in the filename.

1 Like

I was just typing “command line on Mac should be a bash, so quoting the filename should work”.

Using spaces in filenames is good to find problems in software but if you are not into that, just try to avoid them. At least keep your image archive “space free” – that includes filenames and folders.

Heh, the editor removed my backslashes … I just wrote the same thing

There they are, needed to double them.

Hello and thanks to all. The escaped " made the trick. Thank you!