ruby on rails - Dragonfly Imagemagick rotate, than crop than resize -
i using jquery plugin allows basic image manipulation: cropping, rotating, zooming, etc.
i able rotate image:
image = photo.image.rotate(wrapper.rotate)
i able crop image
image.thumb("#{wrapper.width}x#{wrapper.height}+#{wrapper.x}+#{wrapper.y}")
however, can't figure out way resize image after cropping it. basically, want run:
image.thumb("300x200!")
once more.
i understand image.thumb() returns dragonfly job, possible preform process after cropping it?
some context on why want this: user can pan on specific area of image visible in 300x200px container. of time, image way larger 300x200px, want re-size after cropping reduce filesize.
instead of trying given methods, use .convert , pass normal image magic arguments 1 lone string e.g
image.convert("-gravity center -crop '#{wrapper.width}x#{wrapper.height}+#{wrapper.x}+#{wrapper.y}' -resize '300x200!'")
Comments
Post a Comment