Skip to content
New issue

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

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

Already on GitHub? # to your account

[Feature] Max image dimensions configuration for images #62

Closed
colbyfayock opened this issue Sep 1, 2023 · 1 comment · Fixed by #78
Closed

[Feature] Max image dimensions configuration for images #62

colbyfayock opened this issue Sep 1, 2023 · 1 comment · Fixed by #78
Labels

Comments

@colbyfayock
Copy link
Collaborator

colbyfayock commented Sep 1, 2023

Feature Request

Is your feature request related to a problem? Please describe.

We can allow configuration of a "max size" to avoid images being delivered beyond that size

This can be done using c_limit, which will downscale but not upscale while preserving aspect ratio

If we do something along the lines of c_limit,w_900,h_900, this will:

  • scale width to 900 if landscape and width is above
  • scale height to 900 if portrait and height is above
  • preserving the aspect ratio
  • not upscaling at all

Describe the solution you'd like

Can be along the lines of:

[[plugins]]
  package = "netlify-plugin-visual-diff"
    [plugins.inputs]
    
      [[plugins.inputs.maxSize]]
        width = 900
        height = 900

Which would provide blanket downscaling as a max size for all images:

  • Both attributes are optional
  • Only apply a width or height to the image if specified
  • Only add c_limit along with that if provided
@colbyfayock colbyfayock changed the title [Feature] Max size configuration for images [Feature] Max image dimensions configuration for images Sep 6, 2023
@colbyfayock colbyfayock mentioned this issue Sep 18, 2023
11 tasks
colbyfayock added a commit that referenced this issue Sep 20, 2023
# Description

Allows the ability to pass in the maxSize option where you can configure
a maximum width and height to use for images.

Images will automatically resize down to the maximum values preserving
the aspect ratio.

It will also not upscale, only downscale.

```
[plugins.inputs.maxSize]
width = 1200
height = 800
```

## Issue Ticket Number

<!-- Specifiy which issue this fixes by referencing the issue number
(`#11`) or issue URL. -->
<!-- Example: Fixes
#1 -->

Fixes #62 

## 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)
- [ ] 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/colbyfayock/netlify-plugin-cloudinary/issues)
ticket for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/netlify-plugin-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
github-actions bot pushed a commit that referenced this issue Sep 20, 2023
# [1.11.0](v1.10.2...v1.11.0) (2023-09-20)

### Features

* Max Size ([#78](#78)) ([57cb8fb](57cb8fb)), closes [#11](#11) [#62](#62)
@github-actions
Copy link

🎉 This issue has been resolved in version 1.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

matiasfha pushed a commit to matiasfha/netlify-plugin-cloudinary that referenced this issue Sep 23, 2023
# Description

Allows the ability to pass in the maxSize option where you can configure
a maximum width and height to use for images.

Images will automatically resize down to the maximum values preserving
the aspect ratio.

It will also not upscale, only downscale.

```
[plugins.inputs.maxSize]
width = 1200
height = 800
```

## Issue Ticket Number

<!-- Specifiy which issue this fixes by referencing the issue number
(`cloudinary-community#11`) or issue URL. -->
<!-- Example: Fixes
cloudinary-community#1 -->

Fixes cloudinary-community#62 

## 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)
- [ ] 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/colbyfayock/netlify-plugin-cloudinary/issues)
ticket for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/netlify-plugin-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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant