This commit is contained in:
chiu 2021-03-31 08:27:24 +08:00
parent ec5de28e05
commit 692036531c
1 changed files with 2 additions and 2 deletions

View File

@ -174,12 +174,12 @@ class GalleryUploader < CarrierWave::Uploader::Base
def transparent?(*arg)
now_id = model.album_id.to_s
now_album = Album.all.select { |value| (now_id==value.id.to_s)}[0]
now_album.album_colors.first['color']=='transparent' rescue false
now_album.album_colors.first['color']=='transparent' rescue true
end
def pad_process (w,h)
now_id = model.album_id.to_s
now_album = Album.all.select { |value| (now_id==value.id.to_s)}[0]
resize_and_pad(w, h, (now_album.album_colors.first['color']=='transparent' ? :transparent : now_album.album_colors.first['color']), 'Center')
resize_and_pad(w, h, ((now_album.album_colors.first['color']=='transparent' rescue true) ? :transparent : now_album.album_colors.first['color']), 'Center')
end
end