I want to be able to resize the default profile image I use with Paperclip. This is the code in my model:
has_attached_file :photo,
:styles => {
:tiny => "25x25#",
:thumbnail => "100x100#",
:small => "150x150>",
:medium => "300x300>" },
:default_url => "/images/default.png"
However, the default image doesn't get resized like the user submitted images do. How can I do this?
The solution I've been using is to specify the style for the default image:
has_attached_file :photo,
:styles => {
:tiny => "25x25#",
:thumbnail => "100x100#",
:small => "150x150>",
:medium => "300x300>" },
:default_url => "/images/default_:style.png"
Then create a default image for each style (eg: default_tiny.png that is 25x25px, etc...)
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With