diff --git a/lib/letter_avatar.rb b/lib/letter_avatar.rb index 9e2d0c5324f..62915edcaba 100644 --- a/lib/letter_avatar.rb +++ b/lib/letter_avatar.rb @@ -74,15 +74,15 @@ class LetterAvatar -size #{FULLSIZE}x#{FULLSIZE} xc:#{to_rgb(color)} -pointsize #{POINTSIZE} - -fill '#FFFFFFCC' - -font 'Helvetica' + -fill #FFFFFFCC + -font Helvetica -gravity Center - -annotate -0+26 '#{letter}' + -annotate -0+26 #{letter} -depth 8 - '#{filename}' + #{filename} } - Discourse::Utils.execute_command('convert', instructions.join(" ".freeze)) rescue nil + Discourse::Utils.execute_command('convert', *instructions) ## do not optimize image, it will end up larger than original filename @@ -90,7 +90,7 @@ class LetterAvatar def to_rgb(color) r,g,b = color - "'rgb(#{r},#{g},#{b})'" + "rgb(#{r},#{g},#{b})" end def image_magick_version diff --git a/spec/controllers/user_avatars_controller_spec.rb b/spec/controllers/user_avatars_controller_spec.rb index 38c93ccb6f3..d09bc36568f 100644 --- a/spec/controllers/user_avatars_controller_spec.rb +++ b/spec/controllers/user_avatars_controller_spec.rb @@ -10,7 +10,7 @@ describe UserAvatarsController do end it 'returns an avatar if we are allowing the proxy' do - response = get :show_proxy_letter, version: 'v2', letter: 'a', color: 'aaaaaa', size: 20 + response = get :show_proxy_letter, version: 'v2', letter: 'a', color: 'aaaaaa', size: 360 expect(response.status).to eq(200) end end