Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:58:08+00:00 2026-05-27T12:58:08+00:00

Like this I am currently uploading a file ( image ) in my ruby

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:58:08+00:00Added an answer on May 27, 2026 at 12:58 pm

    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:

    ImageScience.with_image("#{RAILS_ROOT}/public/data/#{name}") do |image|
      image.thumbnail(100) do |thumb|
        thumb.save <path_to_small_image to be saved>
      end     
    end
    

    MiniMagick:

    MiniMagick::Image.new("#{RAILS_ROOT}/public/data/#{name}").resize "100x100"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My code currently looks like this: private Foo myFoo; public Foo CurrentFoo { get
My code currently looks like this: <div style=position: fixed; width: 35.25%; height: 6.75%; left:
My webpage currently looks like this: <asp:Table runat=server style=position: absolute; left: 0%; top: 82%;
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
I'm currently displaying a UIViewController like this: [[self navigationController] presentModalViewController:modalViewController animated:YES]; and hiding it
I'm currently doing something like this in some code I'm working on right now:
I am currently doing something like this: myFunc(tracer); function tracer(message:String):void{ trace(message); } function myFunc(callback:Function):void{
I'm currently watching my log files like this tail -f and every now and
I'm currently doing it like this: MessageQueue queue = new MessageQueue(.\Private$\myqueue); MessageEnumerator messageEnumerator =
I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.