Avoid png file uploads with RSpec + Paperclip + Imagemagick

Posted Over 10 years ago. Visible to the public.

File uploads with .png are +10 times slower than using .jpeg or .gif.

# Bad
post :create, {
  :property_id => property.id,
  :photo => {
    :image => File.open("#{Rails.root}/public/images/foo.png")
  }
}

# Good
post :create, {
  :property_id => property.id,
  :photo => {
    :image => File.open("#{Rails.root}/public/images/foo.jpeg")
  }
}
[Removed]
Last edit
Over 10 years ago
Posted by [Removed] to HouseTrip Deck (2013-08-15 13:04)