fix orientation problem
This commit is contained in:
parent
863d89e46b
commit
605c7d467f
|
@ -32,6 +32,11 @@ class GalleryUploader < CarrierWave::Uploader::Base
|
|||
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def fix_exif_rotation
|
||||
manipulate! do |img|
|
||||
img.tap(&:auto_orient)
|
||||
end
|
||||
end
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
|
@ -50,14 +55,17 @@ class GalleryUploader < CarrierWave::Uploader::Base
|
|||
# end
|
||||
|
||||
version :thumb do
|
||||
process :fix_exif_rotation
|
||||
process :resize_to_fill => [200, 200]
|
||||
end
|
||||
|
||||
version :theater do
|
||||
process :fix_exif_rotation
|
||||
process :resize_to_limit => [1920, 1080]
|
||||
end
|
||||
|
||||
version :mobile do
|
||||
process :fix_exif_rotation
|
||||
process :resize_to_limit => [1152, 768]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue