markevans / dragonfly

A Ruby gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!
http://markevans.github.io/dragonfly
MIT License
2.12k stars 244 forks source link

Split out ImageMagick wrapper #377

Open afeld opened 9 years ago

afeld commented 9 years ago

Dragonfly is a great gem and I've been using it for years as an ImageMagick library, but don't need the other functionality. Thoughts about splitting the image processing code into its own gem? I think it will be relatively easy, but happy to help do the work.

pineapplethief commented 9 years ago

AFAIK, there is already a wrapper gem for ImageMagick, called 'RMagick'. It may be what you want.

afeld commented 9 years ago

There are a bunch, but I happen to like the chainable syntax and extensibility of the Dragonfly wrapper. My particular use case is from the magickly gem, just FYI.

markevans commented 9 years ago

It's something I've considered - i.e. literally splitting out that directory without modification.

The only thing is, although it doesn't explicitly depend on the rest of dragonfly, it deals with content objects that conform to a particular spec https://github.com/markevans/dragonfly/blob/master/lib/dragonfly/image_magick/processors/convert.rb#L6, i.e. respond to env, shell_update, etc., which is provided by the Dragonfly::Content object, so for that reason you'd probably want the rest of dragonfly anyway.

Of course it could be refactored not to need these, but shell_update etc. are generally useful for shell escaping, etc.

I'd potentially split it out so that people could use dragonfly without the imagemagick stuff, but I can't see an easy way of having the imagemagick stuff standalone without requiring dragonfly anyway. any thoughts @afeld ?