Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #5767

Closed
Open
Created Dec 05, 2013 by Administrator@rootOwner

Wrong image size for non-Gravatar avatars in network graph

Created by: zeeZ

Users with gravatar images are scaled correctly in the network graph, non-gravatar users have their avatar image used at full size, showing only the top left corner of the image in the graph. clipboard01

In the generated SVG defs, a gravatar icon looks like this:

<pattern id="..." x="0" y="0" patternUnits="userSpaceOnUse" height="20" width="20" patternTransform="matrix(1,0,0,1,0,0) translate(230,460)" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><image x="0" y="0" xlink:href="http://www.gravatar.com/avatar/0bbde2afaa25d3bceacd2a0b5598fbaf?s=20&amp;d=mm" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);" width="20" height="20"></image></pattern>

Any other icon looks like this:

<pattern id="..." x="0" y="0" patternUnits="userSpaceOnUse" height="300" width="300" patternTransform="matrix(1,0,0,1,0,0) translate(230,10)" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><image x="0" y="0" xlink:href="/uploads/user/avatar/2/google.png" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);" width="300" height="300"></image></pattern>

Dimensions (width, height) in both <pattern/> and <image/> are set to the image's actual size. This works for Gravatar images since the image requested already has the proper dimensions to fit the rect in the graph. Manually changing the dimensions in defs for both <pattern/> and <image/> to 20px for uploaded images makes them look correct in the graph.

Sadly, I do not know where those defs are generated from, so it'd be up to someone else to set all image dimensions to a fixed size instead of using their actual values.

Assignee
Assign to
Time tracking