From: Tom Hughes Date: Mon, 9 Jul 2018 19:26:37 +0000 (+0100) Subject: Return the "large" image from the user details API call X-Git-Tag: live~3481 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/f70edc02f086d97727453e738e9f0083c68ec706?ds=sidebyside;hp=d66b4b3d2f379ed61ef2b33bb2b0507267827f98 Return the "large" image from the user details API call Closes #1923 --- diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 27d6faa8c..065a562c4 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -38,7 +38,7 @@ module UserHelper if user.image_use_gravatar user_gravatar_url(user, options) else - image_url(user.image.url) + image_url(user.image.url(:large)) end end diff --git a/app/views/user/api_read.builder b/app/views/user/api_read.builder index 4ed8c9e94..e9cebd5ae 100644 --- a/app/views/user/api_read.builder +++ b/app/views/user/api_read.builder @@ -10,7 +10,7 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do else xml.tag! "contributor-terms", :agreed => @user.terms_agreed.present? end - xml.tag! "img", :href => user_image_url(@user, :size => 256) if @user.image.file? || @user.image_use_gravatar + xml.tag! "img", :href => user_image_url(@user) if @user.image.file? || @user.image_use_gravatar xml.tag! "roles" do @user.roles.each do |role| xml.tag! role.role diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb index eedc8775c..c57299a96 100644 --- a/test/helpers/user_helper_test.rb +++ b/test/helpers/user_helper_test.rb @@ -59,7 +59,7 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) url = user_image_url(user) - assert_match %r{^/attachments/users/images/\d{3}/\d{3}/\d{3}/original/d41d8cd98f00b204e9800998ecf8427e.jpg$}, url + assert_match %r{^/attachments/users/images/\d{3}/\d{3}/\d{3}/large/d41d8cd98f00b204e9800998ecf8427e.jpg$}, url url = user_image_url(gravatar_user) assert_match %r{^http://www.gravatar.com/avatar/}, url