TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: React/web component for responsive images on steroids

17 pointsby lourotalmost 2 years ago
Hey, OP here. This is hopefully interesting, especially for front-end developers. Nowadays images (JPEG, PNG, ...) can contain so-called Image Regions in their metadata [1] like cropping regions or regions of interest. So we&#x27;ve created a React component [2] that responsively displays the &quot;best&quot; cropping region, i.e. the one with the ratio closest to the current `&lt;img&gt;` element size. If you don&#x27;t use React we have also built a web component. [3] With this approach you no longer have to worry about whether the size of your assets will match the ratio of their containers on all devices. The displayed image will always make sense and you don&#x27;t need to maintain a bunch of hard crops anymore. Check out our demo [4] to see it in action. Feel free to ask us any questions, provide feedback, or contribute. We hope this will be useful to someone!<p>[1]: <a href="https:&#x2F;&#x2F;iptc.org&#x2F;std&#x2F;photometadata&#x2F;specification&#x2F;IPTC-PhotoMetadata#image-region" rel="nofollow noreferrer">https:&#x2F;&#x2F;iptc.org&#x2F;std&#x2F;photometadata&#x2F;specification&#x2F;IPTC-PhotoM...</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;Frameright&#x2F;react-image-display-control">https:&#x2F;&#x2F;github.com&#x2F;Frameright&#x2F;react-image-display-control</a><p>[3]: <a href="https:&#x2F;&#x2F;github.com&#x2F;Frameright&#x2F;image-display-control-web-component">https:&#x2F;&#x2F;github.com&#x2F;Frameright&#x2F;image-display-control-web-comp...</a><p>[4]: <a href="https:&#x2F;&#x2F;react.frameright.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;react.frameright.io&#x2F;</a>

2 comments

brilloutalmost 2 years ago
Very nice. Added to <a href="https:&#x2F;&#x2F;github.com&#x2F;brillout&#x2F;awesome-react-components">https:&#x2F;&#x2F;github.com&#x2F;brillout&#x2F;awesome-react-components</a>.
rednixalmost 2 years ago
very cool stuff!