Friday, February 12, 2010

Convert: missing an image filename, Command not found

convert: missing an image filename 'image-test.jpg'.

sh: line 1: image-test.jpg: command not found

Running the convert function through system() in a PHP script may result in the following error, "convert: missing an image filename"

The filename has been passed correctly to convert. The error persists.

Why does the error appear?

Line breaks. During the dump process it is possible that extra line breaks were added to the filenames.

Line breaks are invisible. That is why you cannot see the problem in the filename. The problem is not visible.

The solution is to run a trim() on all the filenames. That will instantly clean up and remove all the extra line breaks.

No comments: