ipx icon indicating copy to clipboard operation
ipx copied to clipboard

feat: add experimental unflatten handler for image processing

Open nathanchase opened this issue 1 year ago • 4 comments

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.

nathanchase avatar Nov 22 '24 14:11 nathanchase

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?

pi0 avatar Nov 22 '24 14:11 pi0

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 :warning:
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              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

codecov[bot] avatar Nov 22 '24 14:11 codecov[bot]

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 avatar Nov 22 '24 19:11 nathanchase

For what it's worth, unflatten has been in sharp since April 2023. https://github.com/lovell/sharp/issues/1648#issuecomment-1525238474

nathanchase avatar Nov 22 '24 19:11 nathanchase