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 picture-lqip format with low quality base64 image #662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pzerelles
Copy link
Contributor

  • 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, ...)
    Feature

  • What is the new behavior (if this is a feature change)?
    The picture output can have a low quality base64 image.

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

  • Other information:

Copy link

changeset-bot bot commented Nov 29, 2023

🦋 Changeset detected

Latest commit: dfc32a9

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

Copy link

codecov bot commented Nov 29, 2023

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 ⚠️
Additional details and impacted files
@@           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 Coverage Δ
imagetools-core 94.17% <94.44%> (+<0.01%) ⬆️
vite-imagetools 94.17% <94.44%> (+<0.01%) ⬆️

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.

@benmccann
Copy link
Collaborator

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 #86 (comment). 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

@benmccann benmccann mentioned this pull request Mar 28, 2024
4 tasks
@pzerelles
Copy link
Contributor Author

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

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.

None yet

2 participants