Comments (5)
Is very important bug
from paperclip.
I had this problem as well, here is my Paperclip options hash:
{
:styles => {
:large => ['500x500>', :png],
:medium => ['350x350>', :png],
:small => ['', :png],
:thumb => ['', :png]
},
:processors => lambda { |asset| asset.video? ? [:video_thumbnail] : [:thumbnail] },
:convert_options => {
:small => '-resize "215x" +repage -crop "215x160+0+0" -gravity North',
:thumb => '-resize "50x" +repage -crop "50x50+0+0" -gravity North'
},
:default_style => :thumb,
:default_url => '/images/converting/:style.gif',
:storage => :s3,
:bucket => 'ce-stage',
:s3_credentials => File.expand_path('config/s3.yml', Rails.root),
:s3_headers => {
'Expires' => 5.years.from_now
},
:path => "revisions/:id_partition/:style.:content_type_extension",
:url => "/revisions/:id_partition/:style.:content_type_extension"
}
from paperclip.
dewski, you are my hero of today.
+1 on this problem.
edit: I ended up going with -resize "80x80^" +repage -gravity north -crop "80x80+0+0"
to force a square regardless of original aspect ratio.
from paperclip.
This is what you need to make it work...
:styles => { :grid => "" },
:convert_options => {
:grid => '-resize "200x" -gravity Center -crop "200x125+0+0"'
}
As dewski shows, you need to remove your size for the main style otherwise paperclip resizes your image before the custom options are run causing :convert_options to be evaluated against a lower resolution version of your image. Also the gravity option needs to be set before the crop option.
from paperclip.
This issue seems to have been resolved by @dewski.
from paperclip.
Related Issues (20)
- Upload file apk to s3 HOT 1
- AWS::S3::Errors::NoSuchKey No Such Key
- Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: HOT 3
- How to store original in different storage bucket?
- PaperClip 2.8 - Rails 2.3 - Ruby 1.87 - OpenSSL::SSL::SSLError (SSL_read:: shutdown while in init): HOT 2
- With Ruby 3.0 validator produces "ArgumentError: wrong number of arguments (given 3, expected 1..2)" HOT 6
- Paperclip mimemagic dependency licensing implication HOT 11
- Transfer ownership of gem to Kreeti HOT 3
- Generate s3 bucket key from DB records
- Migrate to ActiveStorage without re-uploading files?
- default_url is always hit with a HTTP request
- Paperclip::AdapterRegistry::NoHandlerError:
- "attachment" type migration error in Rails 7 HOT 5
- Uploading same attachment twice.
- Uploading same attachment twice fails until i refresh the ui after first upload.
- *_file_name attribute without extension
- Webp image upload issue HOT 2
- use file -b --mime 'test.json' have problem in AWS linux 2
- ContentTypeDetector false positive from Mime HOT 1
- s3 deprecating TLS 1.1 and moving to default TLS 1.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paperclip.