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

feat: add effort directive #618

Merged
merged 7 commits into from
Mar 27, 2024
Merged

Conversation

moorejs
Copy link
Contributor

@moorejs moorejs commented Oct 10, 2023

  • Quick Checklist
  • I have read the contributing guidelines
  • I have written new tests, as applicable (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • I have added a changeset, if applicable
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

New directive to control the encoding effort.

  • What is the new behavior (if this is a feature change)?

Users can specify efforts values that differ from the default effort for a given format.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this
    PR?)

No

  • Other information:

"min" and "max" keywords create a dependency on the format value in the metadata of the image. This was a compromise since specifying an exact number doesn't really make sense if you're generating multiple formats:
e.g. ?format=webp;avif&effort=7 would mean webp effort is default since it is out of range.

@changeset-bot
Copy link

changeset-bot bot commented Oct 10, 2023

🦋 Changeset detected

Latest commit: 21bf449

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

This PR includes changesets to release 2 packages
Name Type
imagetools-core Minor
vite-imagetools 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

@moorejs moorejs force-pushed the moorejs/effort branch 2 times, most recently from e14e856 to ab3b1fd Compare October 10, 2023 16:23
Covers platform difference between mac and linux (sharp#3783)
This pattern is already used elsewhere
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.17%. Comparing base (5b75d3f) to head (21bf449).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #618      +/-   ##
==========================================
+ Coverage   93.64%   94.17%   +0.52%     
==========================================
  Files          32       33       +1     
  Lines        1196     1235      +39     
  Branches      193      206      +13     
==========================================
+ Hits         1120     1163      +43     
+ Misses         76       72       -4     
Flag Coverage Δ
imagetools-core 94.17% <100.00%> (+0.52%) ⬆️
vite-imagetools 94.17% <100.00%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/directives.md Outdated Show resolved Hide resolved
@moorejs
Copy link
Contributor Author

moorejs commented Nov 1, 2023

Thanks for the review. Generating docs appears to function now but the links are relative to my fork so I'll defer that.

@benmccann
Copy link
Collaborator

Thank you! Sorry for the delay in merging this. I'll do a release after I get through a bit more of the PR queue

@benmccann benmccann merged commit dc2f16f into JonasKruckenberg:main Mar 27, 2024
6 checks passed
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.

2 participants