diff --git a/app/labor/generated_image.rb b/app/labor/generated_image.rb index 91ed54a13..0f6cbd835 100644 --- a/app/labor/generated_image.rb +++ b/app/labor/generated_image.rb @@ -19,9 +19,16 @@ class GeneratedImage end def she_coded_image_path(article) - path = cl_image_path(article.user.profile_image_url || "http://41orchard.com/wp-content/uploads/2011/12/Robot-Chalkboard-Decal.gif", :sign_url=>true, :type=>"fetch", :transformation=>[ - {:height=>520, :width=>420, :crop=>"imagga_scale"}, - {:effect=>"sharpen:50", :gravity=>"east", :underlay=>"nevertheless-shecoded-2_q0c81o"} + user_name = article.user.name.length >= 15 ? article.user.name.split(" ").first : article.user.name + she_coded_font_size = user_name.length >= 10 ? 50 : 60 + path = cl_image_path(article.user.profile_image_url || "http://41orchard.com/wp-content/uploads/2011/12/Robot-Chalkboard-Decal.gif", + sign_url: true, type: "fetch", transformation: [ + { height: 150, width: 150, radius: "max", crop: "imagga_scale" }, + { underlay: "nevertheless-she-coded-08_vbwnoc", x: "280", y: "10" }, + { overlay: "text:NixieOne.ttf_#{she_coded_font_size}_normal_normal_normal_left_FFFFFF_2:Nevertheless%252C%0A#{user_name}%20Coded", color: "#FFFFFF", gravity: "east", x: "50", y: "-10", bo: "FFFFFF_2" }, + # font is Nixie One. + # Since there isn't a bold version I had to add a stroke onto the text. + # It's 1.25pt on the "nevertheless" and 2pt on the "she coded", #FFFFFF. ]) "#{path}?shecoded&t=#{Time.now.to_i}" end