Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Default 2-Stage Image Sizing #431

Merged
merged 13 commits into from
Feb 22, 2024
Merged

Conversation

colbyfayock
Copy link
Collaborator

@colbyfayock colbyfayock commented Feb 16, 2024

Description

This removes the 2-stage image sizing that occurs on URLs generated via the image component and helpers to avoid producing lower resolution images that necessary for images with a larger original source.

Instead, this primarily provides a post-transformation resize mechanism and a new crop API that provides the ability to customize how crops are applied.

In an original example of:

<CldImage width height crop="fill" ... />

The resulting URL may look like:

/w_width,h_height,c_fill/transformations/w_width,c_limit/

This would always restrict the resulting image from being no larger than the initial width, which is based on the desired render size, not the original image's source size.

With the new crop API, by using:

<CldImage width height crop="fill" ... />

The resulting URL may look like:

transformations/w_width,h_height,c_fill/

And to replicate the original 2-stage effect, you can do:

<CldImage width height crop={{ type: 'fill', source: true }} ... />

Where the resulting URL may look like:

/w_width,h_height,c_fill/transformations/w_width,c_limit/

Please see the RFC for more context and reasoning: #432

Copy link

vercel bot commented Feb 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
next-cloudinary ✅ Ready (Inspect) Visit Preview Feb 22, 2024 8:26pm
@colbyfayock colbyfayock merged commit b8de6f0 into beta Feb 22, 2024
7 checks passed
@colbyfayock colbyfayock deleted the beta+feat/327-image-sizes branch February 22, 2024 20:34
github-actions bot pushed a commit that referenced this pull request Feb 22, 2024
# [6.0.0-beta.9](v6.0.0-beta.8...v6.0.0-beta.9) (2024-02-22)

### Features

* Remove Default 2-Stage Image Sizing ([#431](#431)) ([b8de6f0](b8de6f0))

### BREAKING CHANGES

* Changes how cropping fundamentally works, introduces new functionality behind crop prop
Copy link

🎉 This PR is included in version 6.0.0-beta.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 6.0.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

colbyfayock added a commit that referenced this pull request Feb 26, 2024
# Description

* Migrates project to pnpm

### CldImage, getCldImageUrl, CldOgImage, getCldOgImageUrl
* Removes default 2-stage resizing to avoid low resolution images for
larger source images
  * #327 
  * #431
*
#432

### CldImage
* Deprecates `transformations` in favor of `namedTransformations`

### getCldImageUrl
* Removes types GetCldImageUrl and GetCldOgImageUrl

### CldUploadWidget
* Add Content-Type to CldUploadWidget signature endpoint 
* Deprecates some CldUploadWidget types in favor of natively defined
types from @cloudinary-util/types
* CldUploadWidgetInfo, CldUploadWidgetPropsOptions,
CldUploadWidgetResults

### CldVideoPlayer
* Removes `autoPlay` in favor of `autoplay`
* Video Player: CldVideoPlayerPropsColors
* Deprecates some CldVideoPlayer types in favor of natively defined
types from @cloudinary-util/types
  * CldVideoPlayerPropsColors

## Post-Release TODO
 - [ ] Update cloudinary-examples
   - Signed CldUploadWidget upload endpoints

## Issue Ticket Number

Fixes #363 
Fixes #379 
Fixes #419 
Fixes #327

## Type of change

<!-- Please select all options that are applicable. -->

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


# Checklist

<!-- These must all be followed and checked. -->

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

BREAKING CHANGE: Removes 2-stage cropping and resizing, type and prop deprecations, and more - see Changelog on next.cloudinary.dev
Copy link

🎉 This PR is included in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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