I am using Amazon's S3 for image storage with carrierwave and fog configured. The images seem to store correctly however when I have a 'portrait' image (smaller width than height) it is not displaying correctly, but rather rotating the image on its side.
Any pointers in the right direction would be much appreciated!
uploaders/image_uploader.rb
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
include Sprockets::Helpers::RailsHelper
include Sprockets::Helpers::IsolatedHelper
storage :fog
include CarrierWave::MimeTypes
process :set_content_type
process :resize_to_limit => [420, 0]
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def extension_white_list
%w(jpg jpeg png)
end
end
show.html.haml
= image_tag(@idea.image_attachments.first.image.url).to_s
image_attachment.rb
class ImageAttachment < ActiveRecord::Base
require 'carrierwave/orm/activerecord'
attr_accessible :image, :description
belongs_to :image_attachable, polymorphic: true
mount_uploader :image, ImageUploader
end