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 experimental unflatten handler for image processing #248

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nathanchase
Copy link

This pull request introduces a new handler function to the src/handlers/handlers.ts file. The new function, unflatten, is experimental and its API may change in the future.

New handler function added:

  • src/handlers/handlers.ts: Added the unflatten handler, which calls the unflatten method on the provided pipe. This feature is marked as experimental.

See https://sharp.pixelplumbing.com/api-operation#unflatten for more information.

@pi0
Copy link
Member

pi0 commented Nov 22, 2024

Thanks for PR dear @nathanchase. Wondering is it worth to wait for sharp feature to be stable first?

Do you have some more context why it is in experimental state?

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 56.18%. Comparing base (f666cb4) to head (7dd635f).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
src/handlers/handlers.ts 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248       /-   ##
==========================================
  Coverage   56.02%   56.18%    0.16%     
==========================================
  Files          14       14              
  Lines        1203     1212        9     
  Branches       83       84        1     
==========================================
  Hits          674      681        7     
- Misses        526      528        2     
  Partials        3        3              

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


🚨 Try these New Features:

@nathanchase
Copy link
Author

Thanks for PR dear @nathanchase. Wondering is it worth to wait for sharp feature to be stable first?

Do you have some more context why it is in experimental state?

I don't have any knowledge of why it's experimental. I just know that I have an immediate use case for it with https://github.com/nuxt/image to make all images with a solid white background become transparent backgrounds. I happened to notice it wasn't wired up to sharp's implementation, so this was just meant as a means of connecting to the unflatten functionality that already exists so that I could use it.

@nathanchase
Copy link
Author

For what it's worth, unflatten has been in sharp since April 2023.
lovell/sharp#1648 (comment)

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