JonasKruckenberg / imagetools

Load and transform images using a toolbox :toolbox: of custom import directives!
MIT License
933 stars 59 forks source link

feat: add picture-lqip format with low quality base64 image #662

Open pzerelles opened 11 months ago

pzerelles commented 11 months ago
changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: dfc32a93242e209b07a7e5391844328c5fc091b0

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 | Patch | | 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

codecov[bot] commented 11 months ago

Codecov Report

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

Project coverage is 94.17%. Comparing base (dc2f16f) to head (dfc32a9).

Files Patch % Lines
packages/core/src/output-formats.ts 94.11% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #662 +/- ## ======================================= Coverage 94.17% 94.17% ======================================= Files 33 33 Lines 1235 1270 +35 Branches 206 212 +6 ======================================= + Hits 1163 1196 +33 - Misses 72 74 +2 ``` | [Flag](https://app.codecov.io/gh/JonasKruckenberg/imagetools/pull/662/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonas+Kruckenberg) | Coverage Δ | | |---|---|---| | [imagetools-core](https://app.codecov.io/gh/JonasKruckenberg/imagetools/pull/662/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonas+Kruckenberg) | `94.17% <94.44%> (+<0.01%)` | :arrow_up: | | [vite-imagetools](https://app.codecov.io/gh/JonasKruckenberg/imagetools/pull/662/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonas+Kruckenberg) | `94.17% <94.44%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonas+Kruckenberg#carryforward-flags-in-the-pull-request-comment) to find out more.

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

benmccann commented 7 months ago

If I understood the code here correctly, it looks like this isn't really transforming the image in a way that makes it much smaller (e.g. to display just the dominant background color). I think if we were going to add a feature like this we should do it with different transforms that shrink the image in various ways as mentioned in https://github.com/JonasKruckenberg/imagetools/issues/86#issuecomment-1765384288. We don't have to add them all off the bat, but it might be nice to have two options people could choose between to help us figure out the API

pzerelles commented 7 months ago

It actually takes the smallest size that you specify in the transform for the low quality preview.