Page 1 of 1

Magick: unrecognized gravity type `'Center''

Posted: 2011-01-26T08:48:13-07:00
by mattyh88
Hi,

I just installed the simple_captcha gem for my ruby on rails application. When I run it, I see this error in my console:

StandardError (Error while running convert: Magick: unrecognized gravity type `'
Center'' @ error/convert.c/ConvertImageCommand/1589.
):

I've opened the ruby file with this piece of code in it:

Code: Select all

params = ImageHelpers.image_params(SimpleCaptcha.image_style).dup
params << "-size #{SimpleCaptcha.image_size}"
params << "-wave #{amplitude}x#{frequency}"
params << "-gravity 'Center'"
params << "-pointsize 22"
params << "-implode 0.2"
I know a guy that runs the gem perfectly now, but he's on a linux machine. I'm on Windows. Could it be something to do with the ` ' " signs?

Thx,
Mathew

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-26T09:02:10-07:00
by el_supremo
The error message is complaining about the single quotes around Center.
Use this:

Code: Select all

params << "-gravity Center"
Pete

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-26T09:21:46-07:00
by mattyh88
Thanks for the reply!
I'm a bit further now :)

I'm getting this error now:

StandardError (Error while running convert: Magick: no encode delegate for this
image format `'C:/Users/username/AppData/Local/Temp/simple_captcha20110126-5256-ok
gscu.jpg'' @ error/constitute.c/WriteImage/1180.
):

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-26T10:51:27-07:00
by el_supremo
I think you have the same problem with the filename. It probably has single quotes around it.

Pete

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-26T10:58:05-07:00
by mattyh88
I've been googling it and I think I need the jasper jp2 library?
Go to: http://www.imagemagick.org/Usage/formats/ and search for 'no encode delegate for this image format'

I'm not sure yet how to download/install this on a win 7 system.

//EDIT: another step further: i ran convert -list configure to see which delegate libraries i have installed for imagemagic. Seems 'jpg' is missing. So I need to install the jpg delegate library. Again, not sure where to find this :p, still googling :)

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-27T08:02:20-07:00
by mattyh88
Hm, I just tried

convert test.gif test.jpg

and that worked!

So I think I do have the jpg encode delegate then? Pete, you might be right then with the single quotes :). Should just find where the ruby gem generates the images so I can delete the quotes. :)

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-27T08:46:52-07:00
by magick
Type
  • convert -list format
Look for the JPEG format with a mode of rw (for read / write support). If you can't find JPEG in the list, your version of ImageMagick was built without JPEG support.

Re: Magick: unrecognized gravity type `'Center''

Posted: 2011-01-28T05:41:45-07:00
by mattyh88
okay thanks ! It's in the list. So it should work :)
It'll be the single quotes, like Pete said.