widgets: Fix some issues#1900
Open
mattst88 wants to merge 5 commits into
Open
Conversation
mattst88
commented
May 20, 2026
- widgets: correct OH_Partner_frame.png dimensions, metadata, and test fixtures
- widgets: correct Tiny widget height to match profile_tiny.png (15 → 16)
- widgets: add PNG output format support
- widgets: flatten transparent background to white
Author
|
cc: @Priya5 |
Author
|
Can someone review this? It's pretty trivial. cc: @Niharika1117 |
Contributor
|
Hi @mattst88 , Sorry for the late reply. We will review your PR this week and let you know. |
Author
|
Are there questions? Is there something unclear? Is something difficult to review? I've update all the commit summaries with explanations of what the problem is and what the fix is. Please... just respond and ask a question if there are concerns? |
Contributor
|
Hi @mattst88 , |
Author
|
Done. |
Contributor
|
Hi @mattst88 , Please fix the failing test cases: https://github.com/blackducksoftware/ohloh-ui/actions/runs/27760820553/job/82136604435 |
…fixtures OH_Partner_frame.png had a 1px transparent row at y=0, so all visible content started at y=1. This caused the rendered Detailed widget to appear shifted down with an empty row at the top and the bottom pixel clipped off. The Detailed widget model also reported width: 230 but the frame image is 232px wide, causing the HTML embed <img width="230"> to clip 2px off the right edge. Test fixtures regenerated to match the corrected frame.
profile_tiny.png is 80×16 but the Tiny widget model reported height: 15, causing the HTML embed <img height="15"> to scale the image down by 1px vertically.
Widget image generation produces PNG internally — the pipeline opens OH_Partner_frame.png, composites text and kudos onto it, and returns the result via MiniMagick's to_blob, which emits PNG bytes. Previously those bytes were served as image/gif regardless of what was requested, which is a lie about the Content-Type. Add proper ?format=png support by renaming render_image_for_gif_format to render_image_for_image_format (and the "not supported" equivalent) across all five widget controllers. PNG requests now receive Content-Type: image/png with the same underlying bytes — no conversion needed since the data is already PNG. GIF requests preserve existing behavior for backward compatibility.
OH_Partner_frame.png has an alpha channel — the right-side content area where name, commits, and kudos are composited was transparent rather than opaque white. The kudos laurel badge composited on top has a white background, making the two visually inconsistent: the laurel shows white while surrounding areas are transparent, appearing as a checkerboard in image viewers or taking on the page background color in browsers. Add image.flatten to setup_blank in badge_helper.rb. flatten fills transparent pixels with the current background color, which is already set to white on the line above, producing a fully opaque image before any compositing begins. setup_blank is shared by all three badge types (Account, Partner, Thin), so all affected test fixtures are regenerated.
Author
|
Done. |
Faker-generated org names with special characters (e.g. apostrophes) create broken regexes when passed as strings to must_match. Use must_include instead, which does plain substring matching.
Priya5
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.