ruby on rails - Is there a way to get coordinates of cropping via Rmagick after cropping? -
i have rubyonrails
application. use carrierwave images uploading , jcrop cropping.
i have 2 images: original , cropped image. have no saved coordinates of cropping (crop_z
, crop_y
, crop_w
, crop_h
)
is there way cropping coordinates via rmagick
or solution?
thanks
in general don't think crop coordinates recorded in image metadata. (they're saved in metadata in magick format few people save images in format.) however, may have luck detecting position of cropped image in original using find_similar_region method. pass cropped image target argument. if method finds region in original matches target returns x- , y-offset of region. width , height of region, of course, width , height of cropped image.
Comments
Post a Comment