Binoy Cherian
Binoy Cherian

Reputation: 384

how to convert files with spaces in the names imagemagick

The file path is like C:\test\NPP\223083-A_BELI Frenchips Poulet roti face.eps

The command works for files with no spaces in the files name but with spaces it gives me error as below:

{convert: unable to open image 'C:\test\NPP\223083-A_BELI': No such file or directory @ error/blob.c/OpenBlob/3094.convert: no decode delegate for this image format ' @ error/constitute.c/ReadImage/509.convert: unable to open image 'Frenchips': No such file or directory @ error/blob.c/OpenBlob/3094.convert: no decode delegate for this image format' @ error/constitute.c/ReadImage/509.convert: unable to open image 'Poulet': No such file or directory @ error/blob.c/OpenBlob/3094.convert: no decode delegate for this image format ' @ error/constitute.c/ReadImage/509.convert: unable to open image 'roti': No such file or directory @ error/blob.c/OpenBlob/3094.convert: no decode delegate for this image format' @ error/constitute.c/ReadImage/509.convert: unable to open image 'face.eps': No such file or directory @ error/blob.c/OpenBlob/3094.convert: invalid argument for option '-resize': C:\test\NPP\EpsTestOutputs\epsToJpg.jpg @ error/convert.c/ConvertImageCommand/2588.}

Edit 2: Replacing spaces with %20 in the input file name didn't work, gave me the below error:

{convert: unable to open image 'C:\test\NPP\223083-A_BELI%20Frenchips%20Poulet%20roti%20face.eps': No such file or directory @ error/blob.c/OpenBlob/3094.convert: invalid argument for option '-resize': C:\test\NPP\EpsTestOutputs\epsToJpg.jpg @ error/convert.c/ConvertImageCommand/2588.}

Any help would be greatly appreciated. Please let me know if any information is required.

Upvotes: 1

Views: 2811

Answers (1)

Binoy Cherian
Binoy Cherian

Reputation: 384

Adding quotes and passing parameter to resize fixed this issue. Final string passed to imagemagick is as below

"convert \"C:\\test\\NPP\\223083-A_BELI Frenchips Poulet roti face.eps\" -density 300 -resize 1024x768 C:\\test\\NPP\\EpsTestOutputs\\epsToJpg.jpg"

Thanks to everyone who commented on this question. Cheers

Upvotes: 2

Related Questions