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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

python - How to remove the Xframe Options header in django? -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -