Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 96x96 image size for avatar thumbnails #1619

Closed
2 tasks
benlk opened this issue Jan 23, 2019 · 2 comments · Fixed by #1672
Closed
2 tasks

Add 96x96 image size for avatar thumbnails #1619

benlk opened this issue Jan 23, 2019 · 2 comments · Fixed by #1672
Labels
priority: normal Must be completed before release of this version of plugin. type: bug
Milestone

Comments

@benlk
Copy link
Collaborator

benlk commented Jan 23, 2019

Largo defines a lot of image sizes:

https://github.com/INN/largo/blob/17caa1eadcc889b19af8047d6369428fce8e7823/functions.php#L253-L261

But it doesn't define the one that we use in a lot of places for thumbnails:

https://github.com/INN/largo/blob/7e7b4cd65105c5dab3d5ea9f6dc4bce957d2a7e0/partials/author-bio-description.php#L14-L20

96px x 96px is the default size used by the function get_avatar(), and the size used by Largo's author bio widget, but that 96x96 size is not registered by default in WordPress or in Largo. Here's the list of image sizes in Largo that are registered as of the current 0.5-dev:

var_dump( $_wp_additional_image_sizes, true)
array(8) {
  ["post-thumbnail"]=>
  array(3) {
    ["width"]=>    int(140)
    ["height"]=>    int(140)
    ["crop"]=>    bool(true)
  }
  ["60x60"]=>
  array(3) {
    ["width"]=>    int(60)
    ["height"]=>    int(60)
    ["crop"]=>    bool(true)
  }
  ["medium"]=>
  array(3) {
    ["width"]=>    int(336)
    ["height"]=>    int(9999)
    ["crop"]=>    bool(false)
  }
  ["large"]=>
  array(3) {
    ["width"]=>    int(771)
    ["height"]=>    int(9999)
    ["crop"]=>    bool(false)
  }
  ["full"]=>
  array(3) {
    ["width"]=>    int(1170)
    ["height"]=>    int(9999)
    ["crop"]=>    bool(false)
  }
  ["third-full"]=>
  array(3) {
    ["width"]=>    int(390)
    ["height"]=>    int(500)
    ["crop"]=>    bool(true)
  }
  ["two-third-full"]=>
  array(3) {
    ["width"]=>    int(780)
    ["height"]=>    int(500)
    ["crop"]=>    bool(true)
  }
  ["rect_thumb"]=>
  array(3) {
    ["width"]=>    int(800)
    ["height"]=>    int(600)
    ["crop"]=>    bool(true)
  }
}

Fix:

  • add_image_size( '96x96', 96, 96, true );
  • add note to changelog that this will require regenerating thumbnails (recommend a plugin) or re-uploading avatars.

Largo does define the thumbnail image size to be 140x140, though, so we may be able to add image srcsets to get_avatar via wp_get_attachment_image_srcset as an argument onget_avatar as the fifth parameter array( 'extra_args' => '...' ) but that seems very extra, and only worth implementing as part of a comprehensive srcset review in #1577

@benlk benlk added type: bug priority: normal Must be completed before release of this version of plugin. labels Jan 23, 2019
@benlk benlk added this to the 0.6.2 milestone Jan 23, 2019
@benlk
Copy link
Collaborator Author

benlk commented Jan 23, 2019

@benlk
Copy link
Collaborator Author

benlk commented Aug 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal Must be completed before release of this version of plugin. type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant