I'm using dragonfly ~> 0.9.15
Given an image, I'm confused at how to use the convert method in dragonfly to crop a circular portion from the image with transparent background.
I am able to use a direct image magick command to run it from command line but the example command I found uses actual files and I'm unaware of how to get the file while dragonfly processes it on the fly.
Here's the actual command I took from a stack overflow question with imagemagick.
https://mcmap.net/q/649841/-crop-or-mask-an-image-into-a-circle
convert -size 200x200 xc:none -fill walter.jpg -draw "circle 100,100 100,1" circle_thumb.png
When I tried to achieve the same with dragonfly, this is the config:
require 'dragonfly/rails/images'
Dragonfly[:images].configure do |c|
c.job :crop_circle do
process :resize, "320x440"
encode :png
process :convert, '-virtual-pixel HorizontalTile -background transparent -draw "circle 400,400 400,1" -compose Copy_Opacity -composite'
end
end
I get the error no such image
when this runs in the server log.
How to configure the convert
function for this using the imagemagick commands?