Project

General

Profile

Defect #44645 ยป 0001-Set-width-and-height-on-Gravatar-images-to-avoid-lay.patch

Go MAEDA, 2026-10-20 04:44

View differences:

lib/plugins/gravatar/lib/gravatar.rb
54 54
      # double the size for hires displays
55 55
      options[:srcset] = "#{gravatar_url(email, options.merge(size: options[:size].to_i * 2))} 2x"
56
      image_tag src, options.except(:rating, :size, :default, :ssl)
56
      image_tag src, options.except(:rating, :default, :ssl)
57 57
    end
58 58
    # Returns the base Gravatar URL for the given email hash
test/helpers/avatars_helper_test.rb
93 93
  def test_avatar_with_size_option
94 94
    assert_include 'size=24', avatar('jsmith <jsmith@somenet.foo>', :size => 24)
95
    assert_include 'width="24" height="24"', avatar('jsmith <jsmith@somenet.foo>', :size => 24)
95 96
    assert_include 'width="24" height="24"', avatar(User.anonymous, :size => 24)
96 97
  end
    (1-1/1)