You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
khelll edited this page Oct 25, 2011
·
16 revisions
Simple trick to get the image dimensions generated by some version:
classLogoUploader < CarrierWave::Uploader::Base# ... version:showdo# do the processing you needprocess:resize_to_limit=>[500,500]# and, here comes the trick, use some processor to access the file generatedprocess:get_version_dimensionsenddefget_version_dimensionswidth,height=`identify -format "%wx%h" #{file.path}`.split(/x/)end# ...end