5

I'm trying to wrap an image around a cylinder in RMagick (ImageMagick) and am having a tough time. There are several types of distortions (Barrel, Arc, Affine, etc.) that seem to be a good start but nothing really fits. I also uncovered a lot of complicated command line stuff (with complex math) but that doesn't help me much with RMagick. Fred's ImageMagick scripts contain a cylinderize script but it is pretty complex and does a lot of command line manipulation that I'm having trouble converting to RMagick calls.

Is there anyone out there that has done this before or can convert ImageMagick command lines to RMagick calls?

Richard Hurt
  • 2,049
  • 24
  • 32
  • 8
    if you have a working ImageMagick bash call, why not just shell out to that? – Ian Jul 07 '11 at 21:40
  • That's an idea worth considering but shelling out is a really evil thing to do and should only be attempted as a last resort. I'm positive that this can be accomplished in RMagick, I just don't know how. :( – Richard Hurt Jul 08 '11 at 11:12
  • 9
    I know that there's that "superstition" (I share it to a certain degree), but I think it's largely unfounded. Shelling out in this case, may actually be preferable. RMagick can cause some serious memory problems if you don't do GC correctly. If you shell to another process, there's no risk of any memory problems in your main app. Note also that "evil shell-out" is exactly what MiniMagick does, to great success. – Ian Jul 08 '11 at 16:19

1 Answers1

0

Just to piggyback on what Ian pointed out - it is absolutely okay to shell out when you have to do ImageMagick calls. ImageMagick is known for causing memory leaks and GC problems.

In one very large production system I supported, the imaging system explicitly did not link against IM. Instead, they had an expression builder class that would construct the right shell command to do the conversion. It was more work, but also more stable.

bitops
  • 4,022
  • 3
  • 26
  • 31