Skip to content

Conversation

@williamwmarx
Copy link

Add compression option to fields.image() that enables automatic client-side image compression before saving. Uses browser-image-compression library with Canvas API.

Features:

  • Resize images to maxWidth/maxHeight constraints
  • Target maxFileSize (in bytes)
  • Adjust quality (0-1 for lossy formats)
  • Convert formats (preserve/webp/jpeg)
  • Display before/after file sizes in UI
  • Silent fallback if compression fails or produces larger file
  • Skip SVG (vector) and GIF (animated) files

Add compression option to fields.image() that enables automatic
client-side image compression before saving. Uses browser-image-compression
library with Canvas API.

Features:
- Resize images to maxWidth/maxHeight constraints
- Target maxFileSize (in bytes)
- Adjust quality (0-1 for lossy formats)
- Convert formats (preserve/webp/jpeg)
- Display before/after file sizes in UI
- Silent fallback if compression fails or produces larger file
- Skip SVG (vector) and GIF (animated) files
@changeset-bot
Copy link

changeset-bot bot commented Dec 27, 2025

🦋 Changeset detected

Latest commit: 9def950

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@keystatic/core Minor
@keystar/docs Patch
@example/astro-content Patch
@example/astro Patch
@example/localization Patch
@example/next-app Patch
@example/next-block-builder Patch
@example/next-pages Patch
@keystatic/remix-test-app Patch
keystatic-docs Patch
@keystatic/astro Major
@keystatic/next Major
@keystatic/remix Major
@keystatic/templates-astro Patch
@keystatic/templates-nextjs Patch
@keystatic/templates-remix Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant