Fix gravity bug for resize_to_fill.

This commit is contained in:
BoHung Chiu 2023-04-24 10:13:15 +08:00
parent cb812c983d
commit cdab52dba1
1 changed files with 3 additions and 2 deletions

View File

@ -181,13 +181,14 @@ class GalleryUploader < CarrierWave::Uploader::Base
if thumb_process_option == 0 if thumb_process_option == 0
thumb_process_option = OrbitHelper::SharedHash['gallery'][:thumb_process_option] thumb_process_option = OrbitHelper::SharedHash['gallery'][:thumb_process_option]
end end
resize_gravity = (now_album.resize_gravity rescue 'Center')
case thumb_process_option case thumb_process_option
when 1 when 1
resize_and_pad(w, h, (transparent? ? :transparent : now_album.album_colors.first['color']), (now_album.resize_gravity rescue 'Center')) resize_and_pad(w, h, (transparent? ? :transparent : now_album.album_colors.first['color']), resize_gravity)
when 2 when 2
limit_process(w, h) limit_process(w, h)
when 3 when 3
resize_to_fill(w, h) resize_to_fill(w, h, resize_gravity)
end end
end end
end end