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

Investigate and Implement Rounded Avatar on OG Image #43

Open
loftwah opened this issue Aug 24, 2024 · 2 comments
Open

Investigate and Implement Rounded Avatar on OG Image #43

loftwah opened this issue Aug 24, 2024 · 2 comments

Comments

@loftwah
Copy link
Owner

loftwah commented Aug 24, 2024

We want to explore the possibility of making the user's avatar round in our Open Graph image generator. This change would enhance the visual appeal of our OG images. However, initial research suggests this might be more challenging than initially thought.

Current situation:

  • We're using MiniMagick for image manipulation in our OpenGraphImageGenerator class.
  • The avatar is currently square with a white border.

Tasks:

  1. Research methods to create rounded avatars using MiniMagick:

    • Investigate the circle or roundrectangle operations in ImageMagick.
    • Look into creating a circular mask and compositing it with the avatar.
  2. If a viable solution is found with MiniMagick:

    • Implement the rounding in the OpenGraphImageGenerator class.
    • Ensure the white border is maintained around the circular avatar.
    • Update the avatar positioning code to account for the new circular shape.
  3. If MiniMagick proves too difficult:

    • Investigate alternative Ruby gems that might offer easier circular cropping (e.g., rmagick, image_processing).
    • Consider the performance implications of switching libraries.
  4. If Ruby-based solutions are unsatisfactory:

    • Explore the feasibility of a service using Canvas and Playwright/Puppeteer.
    • Weigh the pros and cons of this approach (complexity, maintenance, performance).
  5. Decision point:

    • Based on the research and prototyping, decide whether to proceed with rounding or keep the square avatar.
    • Document the decision and rationale.
  6. Implementation:

    • If proceeding, implement the chosen solution.
    • If not proceeding, update the issue with the decision to keep square avatars.
  7. Testing:

    • Ensure the OG image generator works correctly with various avatar sizes and formats.
    • Test performance impact, especially if a new approach is implemented.
  8. Documentation:

    • Update any relevant documentation about the OG image generation process.

Remember: The goal is to enhance visual appeal, but not at the cost of significantly increased complexity or performance issues. If the square avatar proves to be the most practical solution, that's acceptable.

Note: OG images are somewhat broken in an unrelated way but shouldn't impact this issue.

@loftwah loftwah self-assigned this Aug 24, 2024
@loftwah
Copy link
Owner Author

loftwah commented Aug 27, 2024

This seems harder than I first thought and Googling isn't finding much besides people recommending not to do it this way. I could make a service to do it with canvas and playwright or puppeteer but I don't think that is ideal. Might give it a miss and stick with square.

@loftwah loftwah changed the title Round avatar on OG image Investigate and Implement Rounded Avatar on OG Image Sep 17, 2024
@loftwah loftwah removed their assignment Sep 17, 2024
@loftwah
Copy link
Owner Author

loftwah commented Sep 23, 2024

This could be used to fix the current OG images too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant