Vexing use of caption
Posted: 2010-09-08T03:04:09-07:00
Hello all,
Platform: Windows Vista 32 bit
Dev env: Visual Studio Express 2008 C++
I've had an utterly frustrating couple of days trying to get/force ImageMagick to do what I want. A friend of mine is using ImageMagick to create blocks of text from the command line with a command in the following form...
convert.exe -size "640 x 480" -pointsize 48 -channel RGBA -fill red -weight 400 -font C:/Windows/Fonts/SCRIPTBL.TTF -gravity Center -background white caption:"this is the caption text and there really is quite a lot of it" -flatten convert_caption_test_release.png
What he ideally wants is to be able to do this and create an in memory image. So far as I can see this isn't possible with the PHP or C++ interfaces because caption: does a number of clever things, first it will wrap the text and second if an image size is specified but no pointsize it will fit the text to the image. Anyway I spent the last day or so hacking various convert.c files (this confusing because there are at least three of them) I thought I had got it working. But in switching back to Release it all started to go wrong.
Going back to basics to track the problem down I have different behaviour in a clean build of the release and debug version of convert.exe The error is have is that when I run the above command with a debug build of convert.exe it works, but with a release build it doesn't. Instead I get the error...
Magick: no decode delegate for this image format `this is the caption text and there really is quite a lot of it' @ error/constitute.c/ReadImage/532.
Magick: missing an image filename `convert_caption_test_release.png' @ error/convert.c/ConvertImageCommand/2953.
I get this running it from the command line or by setting the debug command within Visual Studio. I first came across it when switching back to release from debug build having setup the argv array in code.
I'm sure this was working in Release yesterday, I've tried lots of different ways of adding quotes etc. But it works in debug!
Any ideas, this is sending me crazy,
G
Platform: Windows Vista 32 bit
Dev env: Visual Studio Express 2008 C++
I've had an utterly frustrating couple of days trying to get/force ImageMagick to do what I want. A friend of mine is using ImageMagick to create blocks of text from the command line with a command in the following form...
convert.exe -size "640 x 480" -pointsize 48 -channel RGBA -fill red -weight 400 -font C:/Windows/Fonts/SCRIPTBL.TTF -gravity Center -background white caption:"this is the caption text and there really is quite a lot of it" -flatten convert_caption_test_release.png
What he ideally wants is to be able to do this and create an in memory image. So far as I can see this isn't possible with the PHP or C++ interfaces because caption: does a number of clever things, first it will wrap the text and second if an image size is specified but no pointsize it will fit the text to the image. Anyway I spent the last day or so hacking various convert.c files (this confusing because there are at least three of them) I thought I had got it working. But in switching back to Release it all started to go wrong.
Going back to basics to track the problem down I have different behaviour in a clean build of the release and debug version of convert.exe The error is have is that when I run the above command with a debug build of convert.exe it works, but with a release build it doesn't. Instead I get the error...
Magick: no decode delegate for this image format `this is the caption text and there really is quite a lot of it' @ error/constitute.c/ReadImage/532.
Magick: missing an image filename `convert_caption_test_release.png' @ error/convert.c/ConvertImageCommand/2953.
I get this running it from the command line or by setting the debug command within Visual Studio. I first came across it when switching back to release from debug build having setup the argv array in code.
I'm sure this was working in Release yesterday, I've tried lots of different ways of adding quotes etc. But it works in debug!
Any ideas, this is sending me crazy,
G