netlify-plugin-cloudinary icon indicating copy to clipboard operation
netlify-plugin-cloudinary copied to clipboard

Support Automated Image Scaling with Client Hints

Open gshel opened this issue 1 year ago • 4 comments

Description

The following changes allow users to follow the suggestions outlined in How to Scale an Image Automatically using Client Hints, specifically:

  1. Scaling an image's width automatically (e.g. 100vw returns an image that is the same width as the viewport)
  2. Avoiding cache misses through advanced usage, which allows users to determine the "jumps" between image resource sizes

Changes made:

  1. Accept string or number Inputs for maxSize.height and maxSize.width via netlify.toml
  2. Accept string Inputs for maxSize.crop via netlify.toml

Issue Ticket Number

Fixes https://github.com/cloudinary-community/netlify-plugin-cloudinary/issues/104

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

Checklist

  • [X] I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
  • [X] I have created an issue ticket for this PR
  • [X] I have checked to ensure there aren't other open Pull Requests for the same update/change?
  • [X] I have performed a self-review of my own code
  • [x] I have run tests locally to ensure they all pass
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes needed to the documentation

gshel avatar Dec 05 '23 19:12 gshel