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

  • SEARCH
  • Home
  • 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 3667334
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:59:15+00:00 2026-05-19T01:59:15+00:00

I have paperclip in Rails (3) working with simple cropping, for example the blow

  • 0

I have paperclip in Rails (3) working with simple cropping, for example the blow code makes a simple crop of the thumbnail:

has_attached_file :image, :styles => { :thumb => "90x90#" }, :default_style => :thumb

However I was wondering how do you crop a very specific area of an image; lets say you have an x and y coordinate to start from and then a width and height of the crop.

How do you go about passing a complex style like this in?

  • 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-19T01:59:16+00:00Added an answer on May 19, 2026 at 1:59 am

    Check {size}{offset} combination here:

    http://www.imagemagick.org/script/command-line-processing.php#geometry

    Example where numbers are width, height, x, y:

    90x90+40+30
    

    Paperclip parses the style options string and it is limited to resizing and cropping. Complex ImageMagick options work if they are being passed as :convert_options, because they are added to convert command without modification.

    has_attached_file :image,
      :styles => { :thumb => "" },
      :convert_options => { :thumb => "-crop 90x90+40+30" },
      :default_style => :thumb
    

    Links to thumbnail processor source code and wiki page:

    • https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/thumbnail.rb
    • https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm saving an image upload using Paperclip in Rails, which is working fine. has_attached_file
I have a Rails 3.1 application thats using Paperclip. It's working perfectly locally but
I have a RESTful resource in my Rails app called Photo. I'm using Paperclip
I have an application that uses the Paperclip plugin for image upload. Now that
I have just installed paperclip into my ruby on rails blog application. Everything is
I have a rails app running on Heroku. I am using paperclip for some
I have a working Rails application on version 2.3.5 - I am using many
I'm using paperclip to handle image uploads to rails. it worked fine on my
I'm trying to get an ajax upload working with rails 3.1.3 and paperclip. I
Using Rails 3.2.1 and Paperclip 2.6 I have Paperclip set to use s3 as

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.