Magick: unrecognized gravity type `'Center''

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mattyh88
Posts: 5
Joined: 2011-01-26T06:19:46-07:00
Authentication code: 8675308

Magick: unrecognized gravity type `'Center''

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

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

Post by el_supremo »

The error message is complaining about the single quotes around Center.
Use this:

Code: Select all

params << "-gravity Center"
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
mattyh88
Posts: 5
Joined: 2011-01-26T06:19:46-07:00
Authentication code: 8675308

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

Post 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.
):
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

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

Post by el_supremo »

I think you have the same problem with the filename. It probably has single quotes around it.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
mattyh88
Posts: 5
Joined: 2011-01-26T06:19:46-07:00
Authentication code: 8675308

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

Post 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 :)
mattyh88
Posts: 5
Joined: 2011-01-26T06:19:46-07:00
Authentication code: 8675308

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

Post 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. :)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
mattyh88
Posts: 5
Joined: 2011-01-26T06:19:46-07:00
Authentication code: 8675308

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

Post by mattyh88 »

okay thanks ! It's in the list. So it should work :)
It'll be the single quotes, like Pete said.
Post Reply