# R2 Image Variants

> Resize each image once with Cloudflare Images and serve srcset copies from R2. Install the native plugin from npm; this links to it.

Source: https://emdashcmseverything.com/plugins/r2-image-variants/

- Category: images
- Status: available
- Version: 0.1.1
- Price: Unknown
- Compatibility: Not stated in the public registry profile
- License: MIT
- Maintainer: RJS Tech Solutions LLP
- Download: https://plugins.emdashcms.com/plugins/@rajatag.bsky.social/r2-variants
- Repository: https://github.com/rjstech2020/emdash-plugin-r2-variants
- Published: 2026-10-21

## Description

R2 Image Variants resizes each media image once with the Cloudflare Images binding, stores the copies in R2, and renders `srcset` URLs that point at them.

**This Registry listing is not the plugin.** Installing it from the Registry adds one information page to the admin and nothing else. R2 Image Variants itself is a native plugin, installed from npm:

```sh
npm install emdash-plugin-r2-variants
```

## Why it must be native

The Registry lists sandboxed plugins only, and this plugin can't run in the sandbox. It reads and writes R2 through the site's bindings, resizes with the Images binding, and ships Astro components (`Image` and a Portable Text image block) that replace how images render. Those need a native plugin, registered in `plugins: []` in `astro.config.mjs`.

## Links

- [npm](https://www.npmjs.com/package/emdash-plugin-r2-variants)
- [GitHub](https://github.com/rjstech2020/emdash-plugin-r2-variants)

## Installation

Installing from the Registry adds an information page only; it does not resize any images. To get R2 Image Variants, install the native plugin from npm with `npm install emdash-plugin-r2-variants` and register it in `plugins: []` in `astro.config.mjs`. Full setup, including the Cloudflare bindings it needs: [README](https://github.com/rjstech2020/emdash-plugin-r2-variants#readme).
