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 678753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:11:04+00:00 2026-05-14T01:11:04+00:00

class User < ActiveRecord::Base has_attached_file :photo, :styles => { :square => 100%, :large =>

  • 0
class User < ActiveRecord::Base

  has_attached_file :photo, :styles => { :square => "100%", :large => "100%" },
    :convert_options => {
      :square => "-auto-orient -geometry 70X70#",
      :large => "-auto-orient -geometry X300" },
    :storage  => :s3,
    :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
    :path => ":attachment/:id/:style.:extension",
    :bucket => 'mybucket'

  validates_attachment_size :photo,
    :less_than => 5.megabyte

end

Works great on local machine, but gives me an error on Heroku: There was an error processing the thumbnail for stream.20143
The thing is I want to auto-orient photos before resizing, so they resized properly.

The only working variant now(thanks to jonnii) is resizing without auto-orient:

...
as_attached_file :photo, :styles => { :square => "70X70#", :large => "X300" },
        :storage  => :s3,
        :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
        :path => ":attachment/:id/:style.:extension",
        :bucket => 'mybucket'
...

How to pass additional convert options to paperclip on Heroku?

UPD

I discover, the trouble in “-auto-orient” option. It seems like this option is broken in version of ImageMagick used by Heroku. I created custom paperclip image processor inherited from paperclip’s standard thumbnail:

module Paperclip

  class Ao < Thumbnail

    def transformation_command
      super + " -auto-orient"
    end

   end
end

It works perfect on local machine, but fails on Heroku.

  • 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-14T01:11:04+00:00Added an answer on May 14, 2026 at 1:11 am

    These are the sizes I use. They all work fine on heroku:

    SIZES = {
      :original => "640x480>",
      :thumb => "150x150#",
      :mini => "60x60#",
      :micro => "30x30#"
    }
    

    Make sure your gem version of paperclip is the same as heroku’s. You can specify the specific gem version in your .gems file and in your environment.rb to make sure they line up.

    I’m not sure exactly why your convert_options are causing problems, but if I remember correctly paperclip uses ImageScience directly and your chosen options might be incompatible with the read only heroku file system.

    If this is critical and you need an answer right now I’d raise a support ticket on heroku. If you get a response make sure you post it back here!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 440k
  • Answers 440k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A better option is to typically generate a random hue,… May 15, 2026 at 5:24 pm
  • Editorial Team
    Editorial Team added an answer You could wrap it in a Panel control and set… May 15, 2026 at 5:24 pm
  • Editorial Team
    Editorial Team added an answer You might need to send a User Agent so that… May 15, 2026 at 5:24 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.