# fregante/object-fit-images

🗻 Polyfill object-fit/object-position on <img>: IE9, IE10, IE11, Edge, Safari, ...

Repository: https://github.com/fregante/object-fit-images
Canonical: https://ross.abutalabs.com/products/object-fit-images
Homepage: https://npm.im/object-fit-images
Language: JavaScript
License: MIT
License Family: permissive
Topics: polyfill, css, js, edge, ie, images
Archived: true
Last push: 2024-10-10T12:16:03+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3827, "days_push": 692, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2015, forks 254 (observed 2026-08-28T04:06:05.529901+00:00)

## What it is
A lightweight JavaScript polyfill that adds object-fit and object-position CSS support for <img> elements in browsers that lack it, such as IE9-11, old Edge, and older Safari. It works via CSS setup, requires no extra DOM elements, and preserves src/srcset behavior.

## Use cases
- make object-fit: cover work on img tags in IE11
- polyfill object-position in old Safari
- support srcset images with object-fit in legacy Edge
- fix image cropping in browsers without object-fit support
- apply cover/contain/fill/none/scale-down to images in old browsers

## When to choose
- you must support IE9-11, legacy Edge, or Safari < 10
- you want a tiny, CSS-configured polyfill with no extra elements
- you rely on srcset and dynamic img.src changes

## When to avoid
- you only target modern browsers with native object-fit support
- you need to polyfill object-fit on video or picture elements
- your project has dropped legacy browser support

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, image-processing
- domain: web-development, frontend
- platform: browser
- tags: polyfill, css, object-fit, internet-explorer, safari, images

## Member repositories
- fregante/object-fit-images (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:05.529901+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:00:43.717272+00:00, confidence not recorded.
  - readme: https://github.com/fregante/object-fit-images (fetched 2026-08-28T04:06:05.529901+00:00, sha 49486c525946)
- Data as of 2026-08-30T08:39:29.467469+00:00.
