ImageMagick is a nice collection of image manipulation routines. It’s free, and somehow it should be. It’s powerful, but also works and fails in miracolous ways. It just wasted twenty minutes. My Minutes. It would have taken the person writing the code probably 2 to make the error message a little bit more meaningful. To cut to the chase: When ImageMagick tells you:
convert: Non-conforming drawing primitive definition `image'.
then it’s probably only telling you that it can not open the image you like to draw. In plain command line that would be:
convert -size 700x500 xc:black -draw 'image Over 0,0 400,300 directory/image.jpg' output.jpg
This will fail. It turns out that ImageMagick needs to have a local file NOT with a path component. To sucessfully do what you wanted to do you would have to:
cd directory ; convert -size 700x500 xc:black -draw 'image Over 0,0 400,300 image.jpg' ../output.jpg ; cd ..
Possible, sure. But a hint like “can not open file directory/image.jpg” would have been nice. The best would be path support as suspected. It works everywhere else.
Of course it turned out that this is supposed to be a feature. In the end things start to work when you quote the filename, like in:
convert -size 700x500 xc:black -draw 'image Over 0,0 400,300 "directory/image.jpg"' output.jpg
Otherwise a filename like 123_3×4.jpg would also get you in trouble.