Like this I am currently uploading a file ( image ) in my ruby application .. I need to resize the image after uploading … please help for resizing the image
uploaded_io = params[:category][:thumb]
if uploaded_io != ""
name = uploaded_io.original_filename
if(FileTest.exist?("#{RAILS_ROOT}/public/data/#{name}"))
id = Category.maximum('id').to_s
id = id.to_i+ 1
name =id.to_s+"_"+name
end
Thanks
If you have imagemagick already installed – then use ImageScience or MiniMagick instead, they both use much less resources and work faster, and are installed just as a common gem (actually a little bit more installation for imagescience)
ImageScience:
MiniMagick: