BBC may not a hub for programming-related news, but its development team is famous for the quality of their open source projects, released through the years.
Imager.js is a JavaScript library the BBC Dev Team created to enable dynamic image sizes on their sites, based on the available viewport size and device a user is utilizing to see their websites.
Imager.js uses complex tags inserted inside image source paths. Based on the detected viewport size, these tags get replaced by size parameters, used to dynamically resize the photo, so it fits the available space.
The same system is used for HiDPI devices, Imager.js changing the image file source accordingly to pixel ratio settings, sending an image with a higher pixel density if the user's device supports it.
Using Imager.js might be a little overboard for a smaller project, but when dealing with complex websites, portals, Intranets or other enterprise projects, the library can help developers automate responsive images across all application pages.
Check the library's README file for more usage instructions.
22
Posted on: 18 Jul 2023 22:27 by A. Brown111
Posted on: 18 Jul 2023 22:24 by A. BrownHacked by !Sc-sT
Posted on: 03 Apr 2015 11:11 by A. BrownHacked By !Sc-sT
Posted on: 17 Mar 2015 07:57 by A. Brown
| Tweet |