Do not use ActiveStorage variants, process original avatar
Variants are currently broken. So we process the original file with the most common avatar dimensions and stripping metadata, then hash and upload only that version.
This commit is contained in:
@@ -14,15 +14,16 @@ module LdapManager
|
||||
end
|
||||
|
||||
img_data = @user.avatar.blob.download
|
||||
jpg_data = process(img_data)
|
||||
jpg_data = process_avatar
|
||||
|
||||
Rails.logger.debug { "Storing new jpegPhoto for user #{@user.cn} in LDAP" }
|
||||
result = replace_attribute(@dn, :jpegPhoto, jpg_data)
|
||||
result == 0
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def process(data)
|
||||
def process_avatar
|
||||
@user.avatar.blob.open do |file|
|
||||
processed = ImageProcessing::Vips
|
||||
.source(file)
|
||||
|
||||
Reference in New Issue
Block a user